
2 Jan
2010
2 Jan
'10
10 p.m.
David M. Cotter <me <at> davecotter.com> writes:
i thought this was impossible. but i've caught it in the debugger *right now*!
on thread 28, i've got this code:
boost::mutex::scoped_lock lock(i_mutex);
[snip]
PC --> if (!i_semID->timed_wait(lock, xt)) {
The timed_wait will not hold the lock for the duration of the wait. It takes the lock so it can release it for the duration of the wait and then re-acquire the lock upon the end of the wait before returning. See how condition variables work as you're essentially waiting on the condition of the time duration (xt): http://tinyurl.com/ycn7rnl HTH, -Ryan