Boost logo

Boost :

From: Andrey Semashev (andysem_at_[hidden])
Date: 2007-01-08 17:13:48

Hello Steven,

Tuesday, January 9, 2007, 12:02:24 AM, you wrote:


> There is a potential deadlock in locking_state_machine.hpp

> locking_state_machine<...> fsm1;
> locking_state_machine<...> fsm2;

> Thread A
> fsm1.operator=(fsm2) {
> scoped_lock that_lock(fsm2.m_Mutex);
> Thread B
> fsm2.operator=(fsm1) {
> scoped_lock that_lock(fsm1.m_Mutex);

> The two threads deadlock.

Right, thanks for finding this. I'll try to fix it. I guess, I'll have
to create a global mutex object for the assignment operations and lock
it prior to other two locks and assignment.

Best regards,
 Andrey                            mailto:andysem_at_[hidden]

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