Hartmut Birr wrote:
I think that the fix is correct. If a critical section is entered and left only once. The leave call signals the event. The section is enter again from two different threads. The first thread gets the section because the lock count is -1, the second thread must wait on the event which is already set. Now two different threads owns the section. If a thread enter the section recursive, only the last leave call will set the event if someone else waits on the event.
Yes, you're right. I'm sorry ;)
Best Regards, Thomas