COMMON Darwin Semaphore Bug
COMMON Darwin Semaphore Bug

Fix in Darwin Sempahore. Count variable was not being checked before decrementing, which was
causing issues in managing the queue size, when running  high loads.  Further change is to use
Barrier versions of the OSAtomic functions to make changes visible in other threads.

Further details here:

https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man3/OSAtomicDecrement32.3.html

* All unit tests passing on MacOSX - no other operating system needed checked.
* capturereplay / mamalistenc now working correctly
* publisher / consumer tested

All on Qpid

Signed-off-by: Phil Preston <0dd50b2925e5cec7d8b32647a4e91e97af19ab3c@mac.com>

cloudsmith-io/openmama,fquinner/OpenMAMA,jacobraj/MAMA,philippreston/OpenMAMA,vulcanft/openmama,dmagOM/OpenMAMA-dynamic,fquinner/OpenMAMA,kuangtu/OpenMAMA,cloudsmith-io/openmama,philippreston/OpenMAMA,kuangtu/OpenMAMA,dmagOM/OpenMAMA-dynamic,dmaguire/OpenMAMA,dpauls/OpenMAMA,fquinner/OpenMAMA,dpauls/OpenMAMA,jacobraj/MAMA,dmagOM/OpenMAMA-dynamic,vulcanft/openmama,jacobraj/MAMA,dpauls/OpenMAMA,vulcanft/openmama,kuangtu/OpenMAMA,dpauls/OpenMAMA,MattMulhern/OpenMAMA,jacobraj/MAMA,fquinner/OpenMAMA,cloudsmith-io/openmama,fquinner/OpenMAMA,dmaguire/OpenMAMA,MattMulhern/OpenMAMA,cloudsmith-io/openmama,cloudsmith-io/openmama,dmaguire/OpenMAMA,dmaguire/OpenMAMA,MattMulhern/OpenMAMA,jacobraj/MAMA,fquinner/OpenMAMA,kuangtu/OpenMAMA,MattMulhern/OpenMAMA,vulcanft/openmama,kuangtu/OpenMAMA,MattMulhern/OpenMAMA,MattMulhern/OpenMAMA,dmagOM/OpenMAMA-dynamic,vulcanft/openmama,philippreston/OpenMAMA,cloudsmith-io/openmama,dmagOM/OpenMAMA-dynamic,dmaguire/OpenMAMA,philippreston/OpenMAMA,jacobraj/MAMA,cloudsmith-io/openmama,dpauls/OpenMAMA,MattMulhern/OpenMAMA,kuangtu/OpenMAMA,vulcanft/openmama,dmaguire/OpenMAMA,kuangtu/OpenMAMA,vulcanft/openmama,philippreston/OpenMAMA,philippreston/OpenMAMA,fquinner/OpenMAMA,dpauls/OpenMAMA,philippreston/OpenMAMA,dmagOM/OpenMAMA-dynamic,dmaguire/OpenMAMA,dpauls/OpenMAMA