amethyst / shred

Shared resource dispatcher
Apache License 2.0
234 stars 66 forks source link

Rewrite `ThreadPoolWrapper` to use atomic pointer #162

Open torkleyy opened 5 years ago

torkleyy commented 5 years ago

There seems to be no need to have a lock around an option wrapping an Arc - since we have an (allocated) Arc, we can just use its raw pointer for AtomicPtr, and swap it out whenever the pool should be changed.

cc @AndreaCatania

AndreaCatania commented 5 years ago

Yep, AtomicPtr is enough

AndreaCatania commented 5 years ago

If you want I can do this change, let me know