On Fri, Feb 6, 2015 at 8:18 PM, Niall Douglas <s_sourceforge@nedprod.com> wrote:
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