Open System Services System Calls Reference Manual (G06.25+, H06.03+)

System Functions (n - p) pthread_unlock_global_np(2)
NAME
pthread_unlock_global_np
- Unlocks the threads global mutex
LIBRARY
G-series native OSS processes: /G/system/sysnn/zsptsrl
H-series OSS processes: /G/system/zdllnnn/zsptdll
SYNOPSIS
#include <spthread.h>
int pthread_unlock_global_np(void);
DESCRIPTION
This function unlocks the threads global mutex. Because the threads global mutex is recursive,
the unlock occurs when the number of calls to this function match the number of calls to the
pthread_lock_global_np()
function. For example, if you called pthread_lock_global_np()
three times, then the third time you call pthread_unlock_global_np()
, it unlocks the threads glo-
bal mutex.
If no threads are waiting for the threads global mutex, it becomes unlocked with no current
owner. If one or more threads are waiting to lock the threads global mutex, this function causes
one thread to unblock and try to acquire the threads global mutex. The scheduling policy deter-
mines which thread is unblocked. For the policies SCHED_FIFO and SCHED_RR, a blocked
thread is chosen in priority order, using a rst-in/rst-out (FIFO) algorithm within priorities.
RETURN VALUES
If an error condition occurs, this function returns an integer value indicating the type of error.
Possible return values are:
0 Successful completion.
[EPERM] The threads global mutex is unlocked or owned by another thread.
RELATED INFORMATION
Functions: pthread_lock_global_np(2).
STANDARDS CONFORMANCE
This function is an extension to the XPG4 Version 2 specication and to the following industry
standards:
IEEE Std 1003.1c-1995, POSIX System Application Program Interface
527186-003 Hewlett-Packard Company 5101