druntime thread_needLock()

Sean Kelly sean at invisibleduck.org
Sat Dec 6 08:13:34 PST 2008


Fawzi Mohamed wrote:
> 
> a memory barrier would be needed, and atomic decrements, but I see that 
> it is not portable...

It would also somewhat defeat the purpose of thread_needLock, since IMO 
this routine should be fast.  If memory barriers are involved then it 
may as well simply use a mutex itself, and this is exactly what it's 
intended to avoid.


Sean



More information about the Digitalmars-d mailing list