Spinlock improvement: relax the barrier conditions for lock & unlock. Our trylock and unlock used full barriers. Doing some reading on the net, it seems better to use the GCC intrinsics __sync_lock_test_and_set and __sync_lock_release, which use acquire and release barrier semantics, respectively.  And indeed, the is a substantial performance improvement for both spinlock_test and spin_rw_test benchmarks, and verified by actual use of the TextureSystem in a renderer.
Spinlock improvement: relax the barrier conditions for lock & unlock.
Our trylock and unlock used full barriers. Doing some reading on the net,
it seems better to use the GCC intrinsics __sync_lock_test_and_set and
__sync_lock_release, which use acquire and release barrier semantics,
respectively.  And indeed, the is a substantial performance improvement for
both spinlock_test and spin_rw_test benchmarks, and verified by actual use
of the TextureSystem in a renderer.

cwilling/oiio,scott-wilson/oiio,mcanthony/oiio,cwilling/oiio,OpenImageIO/oiio,micler/oiio,scott-wilson/oiio,sambler/oiio,bdeluca/oiio,scott-wilson/oiio,YangYangTL/oiio,micler/oiio,mcanthony/oiio,micler/oiio,lgritz/oiio,OpenImageIO/oiio,bdeluca/oiio,lgritz/oiio,mcanthony/oiio,sambler/oiio,micler/oiio,cwilling/oiio,bdeluca/oiio,YangYangTL/oiio,scott-wilson/oiio,YangYangTL/oiio,YangYangTL/oiio,bdeluca/oiio,OpenImageIO/oiio,lgritz/oiio,lgritz/oiio,sambler/oiio,cwilling/oiio,sambler/oiio,mcanthony/oiio,OpenImageIO/oiio