[vlc-devel] [PATCH 1/2] win32: implement non-recursive locks

Steve Lhomme robux4 at gmail.com
Fri Jun 24 10:13:08 CEST 2016

On Fri, Jun 24, 2016 at 9:15 AM, Rémi Denis-Courmont <remi at remlab.net> wrote:
> Le 2016-06-24 08:33, Steve Lhomme a écrit :
>> So we can catch un-matched unlocks. Also if we don't we can end up in
>> harder to decypher blocking issues. Here's the doc of
>> LeaveCriticalSection()
>> "If a thread calls LeaveCriticalSection when it does not have
>> ownership of the specified critical section object, an error occurs
>> that may cause another thread using EnterCriticalSection to wait
>> indefinitely."
> Yeah and the counter does not "fix" that problem. You obviously would need
> to track the owner ID to detect and fix that error.

Yes, it's still hard to debug. But better than being stuck on
EnterCriticalSection() even though noone seems to own the critical
section. In gdb it's possible to see the thread ID that owns a
critical section. Not sure what it would look like in that case. I
tried to force the issue but the EnterCriticalSection() doesn't fail
as described in the doc.

> --
> Rémi Denis-Courmont
> http://www.remlab.net/
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel

More information about the vlc-devel mailing list