Thomas Weidenmueller wrote:
I believe this change is incorrect. This change
introduces the exact
same bug I fixed in r14326.
The reason why this change is incorrect is, that you can't rely on
LockCount. It may be incremented anytime a thread enters a critical
section and waits for it. That's why there's the RecursionCount field,
it is the only information we can rely on to determine whether we're
about to release the lock or not. In this code path we already know that
we left the last recursion, so no matter what the LockCount is at the
moment (depends on how many threads are waiting for the critical
section), we always need to unwait one waiter!
This change most likely will introduce a dead-lock of cygwin.
Crap, Never mind, your change is correct. I overlooked one minor thing....
Best Regards,
Thomas