Unlocks a global mutex.
Syntax
pthread_unlock_global_np();
C Binding
#include
int
pthread_unlock_global_np (void);
Arguments
-
- None
Description
This routine unlocks the global mutex. Since the global mutex
is recursive, the unlock will occur when each call to pthread_lock_
global_np has been matched by a call to this routine. For example,
if you called pthread_lock_global_np three times, pthread_unlock_
global_np unlocks the global mutex when you call it the third time.
If no threads are waiting for the global mutex, it becomes unlocked
with no current owner. If one or more threads are waiting to lock
the global mutex, this routine causes one thread to unblock and try
to acquire the mutex. The scheduling policy is used to determine
which thread is awakened. For the policies SCHED_FIFO and SCHED_
RR, a blocked thread is chosen in priority order, using first-in
/first-out within priorities.
Return Values
If an error condition occurs, this routine returns an integer value
indicating the type of error. Possible return values are as follows:
Return Description
0 Successful completion.
[EPERM] The mutex is unlocked or owned by another thread.
Associated Routines
pthread_lock_global_np