smol-rs / async-lock

Async synchronization primitives

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using OnceCell makes caller not Send

sophie-h opened this issue · comments

I have a glocal static with an async_lock::OnceCell. Calls to set() or get_or_init() make the Future not Send.

The same code works with tokio's OnceCell and a similar async_lock::Mutex code does as well. As far as I can tell it is independent from the type inside the cell.

Is it possible to fix this problem?