
17 Mar
2006
17 Mar
'06
9:51 a.m.
Hi, I all the time use mutexs and conditions in in following manner: // declaration Type m_value; mutex m_value_mutex; condition m_value_condition; // set new value { mutex::scoped_lock lock(m_mutex); m_value = new_value; } // wait for some condition { mutex::scoped_lock lock(m_mutex); while(<condition>) m_condition.wait(lock); } I'm wondering about something like this: // declaration monitor<Type> m_value; // set new value - locking in done in a monitor assignment m_value = new_value // wait for some condition m_value.wait(<lambda expression>) Do you think this concept is generally useful and should be added to the library? Regards, Vaclav