Hello, Is there a specific way of initializing the boost::mutex objects? Here is the sequence I have been using: Instantiation of the mutex boost::mutex m_CmdMutex; Then try to lock it m_CmdMutex.lock(); It looks like every time I try to lock a mutex I lock my thread. Anything else needs to be done? Thanks, Jean
Have you tried using the mutex member function try_lock? See: http://www.boost.org/doc/libs/1_36_0/doc/html/thread/synchronization.html#th... Hope this helps! Benjamin
Thanks for the quick answer... The blocking is not the issue here. The
issue is that I don't seem to be able to lock a mutex at all even when
I can insure that no other thread has ever called "lock" before.
On Mon, Oct 6, 2008 at 9:47 AM, Benjamin Lau
Have you tried using the mutex member function try_lock?
See: http://www.boost.org/doc/libs/1_36_0/doc/html/thread/synchronization.html#th...
Hope this helps! Benjamin _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
AMDG Jean-Sebastien Stoezel wrote:
Thanks for the quick answer... The blocking is not the issue here. The issue is that I don't seem to be able to lock a mutex at all even when I can insure that no other thread has ever called "lock" before.
Can you post a small compilable example? The code you posted looks correct without further information. In Christ, Steven Watanabe
participants (3)
-
Benjamin Lau
-
Jean-Sebastien Stoezel
-
Steven Watanabe