21 Feb
2009
21 Feb
'09
5:11 p.m.
AMDG Daniele Barzotti wrote:
while(!data_ready) { cond.timed_wait(lock, xt); }
Ok, The OnDataReceived is called from the SerialPort thread when the data is available. In the SendCommand I have to wait for a timeout or until the answer is arrived...how can I do it?
Use the predicate form of timed_wait. bool ready = cond.timed_wait(lock, xt, boost::lambda::var(data_ready)); In Christ, Steven Watanabe