From: Roland Schwarz (roland.schwarz_at_[hidden])
Date: 2007-08-03 05:12:57


http://boost.org/doc/html/thread/concepts.html#thread.concepts.locking-strategies

Cheng Lian wrote:

> I think this would definitely self deadlock and the program should be
> waiting forever.

No, the behavior is operating system dependent.
See e.g.
http://boost.org/doc/html/thread/concepts.html#thread.concepts.locking-strategies

"With an unspecified locking strategy, when a thread attempts to acquire
a lock on a mutex object for which the thread already owns a lock the
operation results in undefined behavior."

Boost thread currently only provides: "unspecified locking strategy."

roland aka. speedsnail