Locks the global mutex.
cma_lock_global();
#includevoid cma_lock_global (void);
The thread that has locked the global mutex becomes its current owner and remains the owner until the same thread has unlocked it. This routine returns with the global mutex in the locked state and with the current thread as the global mutex's current owner.
Use the global mutex when calling a library package that is not designed to run in a multithreaded environment. (Unless the documentation for a library function specifically states that it is compatible with multithreading, assume that it is not compatible; in other words, assume it is nonreentrant.)
The global mutex is one lock. Any code that calls any function that isn't known to be reentrant uses the same lock. This prevents dependencies among threads calling library functions and those functions calling other functions, and so on.
The global mutex is a recursive mutex. A thread that has locked the global mutex can relock it without deadlocking. (The locking thread must call cma_unlock_global as many times as it called this routine to allow another thread to lock the global mutex.)
Do not call this routine from any software interrupt handler.
cma_e_existence cma_e_use_error