
On Sun, Jan 13, 2013 at 10:43 PM, Vicente J. Botet Escriba <vicente.botet@wanadoo.fr> wrote:
I would like to have an alternative for these platforms to avoid making Boost.Thread fail just because Boost.Atomic is not supported.
It won't fail, it will use the spinlock pool. When the spinlock cannot be implemented with atomic ops (i.e. on a not supported platform) the spinlock is implemented as boost::mutex from Boost.Thread. I realize this would make the implementation suboptimal in case of call_once. In that case we could fallback to a special implementation that only uses pthread API. That would require to always lock the mutex, even when the initialization is already done. PS: It might be worthwhile to actually try to use the spinlocks from pthread API in Boost.Atomic.