Subj : Re: recursive mutexes To : comp.programming.threads,comp.unix.programmer From : David Schwartz Date : Sun May 15 2005 04:13 am "Uenal Mutlu" <520001085531-0001@t-online.de> wrote in message news:d66ogb$2fe$00$1@news.t-online.com... > C and E are redundant, however application code (the current thread) > cannot always know that it alread has the lock, though it could test for > it. Yes, it can and must know that it already has the lock. A function that operates on X should be defined as being called with X locked, or with X unlocked. It could even take a boolean that indicates whether the caller has locked the object or not, though this is rarely the right thing to do. Simply put, the only thing recursive mutexes gives you is the ability to write code that deals with X that can be called whether or not X is locked. This is not only almost never useful, but it's almost always dangerous. DS .