fast-wait-free-queue
fast-wait-free-queue copied to clipboard
Re-use initialized ring queues, instead of leaking
In the LCRQ, when another thread manages to enqueue a new ring queue with CAS before you manage, you have already initialized your RQ. Now the local one is just discarded, which leaks memory.
There is infrastructure in place in the handle to save these initialized ring queues, and later re-use them in future enqueues. This commit fixes that optimization, which seems to have been broken sometime in the past.