[webkit-dev] Expected behavior of Mutex.lock()

Drew Wilson atwilson at google.com
Sat Jun 6 08:57:58 PDT 2009


I can't seem to find any documentation as to what the expected behavior of
Mutex.lock() is with regard to calling lock() recursively on the same
thread.
Looking at the pthreads implementation, it appears that when we create the
mutex we pass null as the attributes, which gives us the default behavior
(not re-entrant).

The Windows implementation uses EnterCriticalSection which *is* re-entrant.

I'm assuming that the pthreads implementation is the correct one (calling
Mutex.lock() twice on the same mutex on a single thread should deadlock the
thread) but I wanted to verify this since the implementations seem to vary.

-atw
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20090606/cf46aa13/attachment.html>


More information about the webkit-dev mailing list