Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

pthread_unlock_global_np(3) [osf1 man page]

pthread_unlock_global_np(3)				     Library Functions Manual				       pthread_unlock_global_np(3)

NAME
pthread_unlock_global_np - Unlocks the DECthreads global mutex. LIBRARY
DECthreads POSIX 1003.1c Library (libpthread.so) SYNOPSIS
#include <pthread.h> int pthread_unlock_global_np(void); STANDARDS
None PARAMETERS
None DESCRIPTION
This routine unlocks the DECthreads global mutex. Because the global mutex is recursive, the unlock occurs when each call to pthread_lock_global_np(3) has been matched by a call to this routine. For example, if you called pthread_lock_global_np(3) three times, pthread_unlock_global_np(3) unlocks the global mutex when you call it the third time. If no threads are waiting for the DECthreads 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 global 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 (FIFO) 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: Successful completion. The mutex is unlocked or owned by another thread. ERRORS
None RELATED INFORMATION
Functions: pthread_lock_global_np(3) Manuals: Guide to DECthreads and Programmer's Guide delim off pthread_unlock_global_np(3)

Check Out this Related Man Page

pthread_lock_global_np(3)				     Library Functions Manual					 pthread_lock_global_np(3)

NAME
pthread_lock_global_np - Locks the DECthreads global mutex. LIBRARY
DECthreads POSIX 1003.1c Library (libpthread.so) SYNOPSIS
#include <pthread.h> int pthread_lock_global_np(void); STANDARDS
None PARAMETERS
None DESCRIPTION
This 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 VALUES
If an error condition occurs, this routine returns an integer value indicating the type of error. Possible return values are as follows: Successful completion. ERRORS
None RELATED INFORMATION
Functions: pthread_unlock_global_np(3) Manuals: Guide to DECthreads and Programmer's Guide delim off pthread_lock_global_np(3)
Man Page

4 More Discussions You Might Find Interesting

1. Programming

Number of threads waiting on a pthread mutex/rwlock

Using pthreads is there a way to determine how many threads are waiting on a locked resource? I mean, once a shared resource is protected using e.g. pthread_rwlock_t or pthread_mutex_t one thread grabs the lock and other threads will go to sleep waiting for the resource to be available again. Is... (0 Replies)
Discussion started by: muggu
0 Replies

2. Programming

design query: where to lock mutex for function accessing global value?

Hi, Suppose I have a function that accesses and increments a global variable . This function is run as part of thread. One locks mutex in the function and unlocks it after the processing is done. Is there any alternative way? Thanks in advance. (1 Reply)
Discussion started by: sanjayc
1 Replies

3. Programming

pthread locking and unlocking.

When more than one thread is waiting for a locked mutex, which thread will be granted the lock first after it is released. In our application we want to implement FIFO thread scheduling policy i.e. Thread should get lock which one requested first for it. AIX have SCHED_FIFO thread scheduling... (1 Reply)
Discussion started by: mukind
1 Replies

4. Red Hat

GTK bug? xcb_io.c: 140

Hi all, Trying to get my application ready for distribution. All looking good until I started getting this error and program termination: My-Program: xcb_io.c:140 dequeue_pending_request: Assertion `req == dpy->xcb->pending_requests` failed Has anyone come accross this? I am working in... (7 Replies)
Discussion started by: fedora18
7 Replies