Boost Users :
Subject: [Boost-users] How to use lock_guard
From: Daniele Barzotti (daniele.barzotti_at_[hidden])
Date: 2009-03-10 06:04:35
I'm tring to use lock_guard, but I have some doubts...
I have a method called OnDataReceived() which is called by another class
through a signal.
// Data received from RS232
// .... CODE ....
// unlock the mutex before notifications
The first time it's called, it works fine.
The second time the flow locks on the creation of the lock object.
In the caller class I have solved this declaring the lock in this manner:
// saving data to vector
//Unlock the mutex
but here because there is the worker thread loop, while in the called
class there is no loop.
Thanks for suggestions.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net