9 Feb
2015
9 Feb
'15
11 a.m.
On Fri, Feb 6, 2015 at 8:18 PM, Niall Douglas
An atomic increment/decrement use count maybe? Slow when contended, but faster possibly than alternatives.
BTW you can fold a lock into a pointer by using its bottom bit as the lock bit. I have an implementation in Boost.Spinlock if you want it.
There's also https://github.com/facebook/folly/blob/master/folly/PackedSyncPtr.h, FWIW. --DD