12 May
2003
12 May
'03
8:07 a.m.
Peter G wrote:
agghhh it clicked... when i lock a mutex, all i am doing is preventing another thread from executing the code that follows until the mutex is unlocked.. regardless of what that code does...
I think your on the right lines. When you lock a mutex, you are preventing any other thread from acquiring a lock on the same mutex until the thread that has locked it successfully, releases that lock. The thread attempting to lock an already locked mutex will block until the mutex is unlocked. Unless you use another type of mutex (e.g. try_mutex or timed_mutex) Cheers Russell