hawkw / sharded-slab

a lock-free concurrent slab (experimental)
MIT License
269 stars 17 forks source link

Poisoned thread leads to confusing panic in `Pool::current` #95

Open gerwin3 opened 7 months ago

gerwin3 commented 7 months ago

In this code:

https://github.com/hawkw/sharded-slab/blob/40579b92debe2ef283a455eb379945e023080ff3/src/shard.rs#L292-L294

Tid::current().as_usize() may return usize::MAX if the thread was poisoned. This makes it hard to debug since the error seems to indicate the user spawned to many threads, which is not the case.