Implementing more of the mutexes in pthreads.