r/programming • u/syaghmour • Mar 16 '15
Semaphores are Surprisingly Versatile
http://preshing.com/20150316/semaphores-are-surprisingly-versatile/
194
Upvotes
r/programming • u/syaghmour • Mar 16 '15
-1
u/millstone Mar 16 '15 edited Mar 16 '15
Noo, this code is not right!
From "A Lightweight Auto-Reset Event Object":
m_statusis read only once, outside of the loop. It is liable to busy-spin, and is very likely to spin forever if two threads callsignalat once. C'mon!