
8 Jan
2007
8 Jan
'07
10:13 p.m.
Hello Steven, Tuesday, January 9, 2007, 12:02:24 AM, you wrote:
AMDG
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@mail.ru