Boost logo

Threads-Devel :

From: Matt Hurd (matt.hurd_at_[hidden])
Date: 2006-03-01 12:11:31


> > Any thoughts on this?
>
> Well, OS Mutexes might be recursive on Windows, but Critical Sections
> aren't.

Huh? I haven't programmed on windows for a bit but I'm pretty sure they are:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/critical_section_objects.asp

<quote>
When a thread owns a critical section, it can make additional calls to
EnterCriticalSection or TryEnterCriticalSection without blocking its
execution. This prevents a thread from deadlocking itself while waiting for a
critical section that it already owns. To release its ownership, the thread
must call LeaveCriticalSection one time for each time that it entered the
critical section. There is no guarantee about the order in which waiting
threads will acquire ownership of the critical section.
</quote>

matt.


Threads-Devel list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk