Use BOOST_INTERLOCKED_EXCHANGE_ADD in preference to BOOST_INTERLOCKED_COMPARE_EXCHANGE, since this should be faster