Fixes #50. Avoids the OnceCell by making ThreadIdManager const-initializable. This doesn't require a MSRV bump as aggressive as #64, as it only requires 1.63 to make Mutex::new const. Unfortunately BinaryHeap::new is still not const, so this PR wraps the freelist in an Option to allow initializing it to zero. It should still be cheaper than the atomic check of a Lazy, and this is only done when new threads are registered.
Fixes #50. Avoids the OnceCell by making
ThreadIdManager
const-initializable. This doesn't require a MSRV bump as aggressive as #64, as it only requires 1.63 to makeMutex::new
const. UnfortunatelyBinaryHeap::new
is still not const, so this PR wraps the freelist in an Option to allow initializing it to zero. It should still be cheaper than the atomic check of aLazy
, and this is only done when new threads are registered.