
4 Nov
2004
4 Nov
'04
12:19 p.m.
Incidentally I found the following, which I think applies to the case: http://users.actcom.co.il/~choo/lupg/tutorials/multi-thread/multi-thread.htm...
... Using A Condition Variable - A Complete Example ...
3. The mutex itself MUST be a recursive mutex. In order to see why, look at the code of the 'handle_requests_loop' function. You will notice that it first locks the mutex, and afterwards calls the 'get_request' function, which locks the mutex again. If we used a non-recursive mutex, we'd get locked indefinitely in the mutex locking operation of the 'get_request' function.
Don't get me wrong, altough I understand the reasoning of the various posters, the use of recursive mutex does not seem to be considered wrong in general. Roland