Completed the acquireMutex, developing releaseMutex.