Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2008-06-02 18:01:58

Johan Torp:

> If I understand you correctly, it can deadlock.

It can deadlock, but it cannot deadlock unexpectedly. That is, it will not
turn code that didn't deadlock into code that deadlocks. Your example:

> Thread A, task 1, pool task:
> submit task 2
> acquire M2
> wait on task 2 // Surprising that this call would acquire locks

> Thread A, task 2, executed from within wait on task 2 statement:
> acquire M1 // Acquired in wrong order

> Thread X: // Acquires mutexes in correct order
> acquire M1
> acquire M2

already deadlocks without reuse.

Boost list run by bdawes at, gregod at, cpdaniel at, john at