[Return to Bookshelf] [Contents] [Previous Section] [Next Section] [Index] [Help]


pthread_unlock_global_np

Unlocks a global mutex.

Syntax

pthread_unlock_global_np();

C Binding

void
pthread_unlock_global_np ();

Arguments

None

Description

This routine unlocks the global mutex 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 acquires the global mutex. For the policies SCHED_FIFO and SCHED_RR, a blocked thread is chosen in priority order, using FIFO within priorities.

The results of calling this routine are unpredictable if the global mutex is already unlocked. The results of calling this routine are also unpredictable if the global mutex is owned by a thread other than the calling thread.

Do not call this routine from any software interrupt handler.

Return Values

None



[Return to Bookshelf] [Contents] [Previous Section] [Next Section] [Index] [Help]