ipc mutex/wait_queue converted to c++.