Locks the specified mutex.
#include <synch.h> int mutex_lock ( mutex_t *mp );
(IN) Points to the mutex to lock.
If successful, returns 0; otherwise returns a nonzero error code:
The mutex_lock function acquires the specified mutually exclusive lock. If the lock being acquired is not free (is held by a different thread), the calling thread waits until the lock can be acquired. No assumptions can be made about the way the calling thread might wait for the lock to become free. The mutex is not guaranteed to be FIFO.