Use boost::mutex.