[ros-dev] Re: [ros-svn] [hbirr] 17538: Fixed a bug in RtlLeaveCriticalSection. We have only to signal the event if someone waits on it.

Thomas Weidenmueller w3seek at reactos.com
Thu Aug 25 15:02:01 CEST 2005


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


More information about the Ros-dev mailing list