Port to C++11's std::mutex from self-written solution.