Implemented mutex via pthreads and critical section.