C++ Boost スレッドを使用した次のコード行があります。
void threadFunc()
{
boost::mutex::scoped_lock lock(m_Mutex);
//some code here...
condition.notify_one();
}
次のように、最後の行の前に unlock() 関数を呼び出す必要がありますか? unlock() を呼び出さない場合の違いは何ですか?
void threadFunc()
{
boost::mutex::scoped_lock lock(m_Mutex);
//some code here...
lock.unlock();
condition.notify_one();
}