Query: pthread_lock_global_np
OS: osf1
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
pthread_lock_global_np(3) Library Functions Manual pthread_lock_global_np(3)NAMEpthread_lock_global_np - Locks the DECthreads global mutex.LIBRARYDECthreads POSIX 1003.1c Library (libpthread.so)SYNOPSIS#include <pthread.h> int pthread_lock_global_np(void);STANDARDSNonePARAMETERSNoneDESCRIPTIONThis routine locks the DECthreads global mutex. If the global mutex is currently held by another thread when a thread calls this routine, the calling thread waits for the global mutex to become available and then locks it. 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 DECthreads global mutex when calling a library package that is not designed to run in a multithreaded environment. Unless the doc- umentation for a library function specifically states that it is thread safe, 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 is not known to be reentrant should use the same lock. This prevents problems resulting from dependencies among threads that call 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 pthread_unlock_global_np(3) as many times as it called this routine, to allow another thread to lock the global mutex.RETURN VALUESIf an error condition occurs, this routine returns an integer value indicating the type of error. Possible return values are as follows: Successful completion.ERRORSNoneRELATED INFORMATIONFunctions: pthread_unlock_global_np(3) Manuals: Guide to DECthreads and Programmer's Guide delim off pthread_lock_global_np(3)
Related Man Pages |
---|
pthread_cond_signal_int_np(3) - osf1 |
pthread_cond_signal(3) - osf1 |
pthread_lock_global_np(3) - osf1 |
pthread_mutex_trylock(3) - osf1 |
pthread_mutexattr_setpshared(3) - osf1 |
Similar Topics in the Unix Linux Community |
---|
Mutex lock question |
design query: where to lock mutex for function accessing global value? |
pthread question : global variable not updated |
pthread locking and unlocking. |
GTK bug? xcb_io.c: 140 |