Yes, it does have the mutex locked. Basically, the mutex gets released only while the thread is blocked in the_condition_variable.wait()
. Spurious wakeup or not, the mutex is locked everywhere else in the code that you show.
From the documentation for boost::condition_variable::wait()
:
Postcondition:
lock
is locked by the current thread.