[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions, Volume 1

pthread_unlock_global_np Subroutine


Unlocks the global mutex.


Threads Library (libpthreads.a)


#include <pthread.h>

void pthread_unlock_global_np ()


The pthread_unlock_global_np subroutine unlocks the global mutex when each call to the pthread_lock_global_np subroutine is matched by a call to this routine. For example, if a thread called the pthread_lock_global_np three times, the global mutex is unlocked after the third call to the pthread_unlock_global_np subroutine.

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, exactly one thread returns from its call to the pthread_lock_global_np subroutine.

  1. The pthread.h header file must be the first included file of each source file using the threads library. Otherwise, the -D_THREAD_SAFE compilation flag should be used, or the cc_r compiler used. In this case, the flag is automatically set.
  2. The pthread_unlock_global_np subroutine is not portable.

Implementation Specifics

This subroutine is part of the Base Operating System (BOS) Runtime.

This subroutine is not POSIX compliant and is provided only for compatibility with DCE threads. It should not be used when writing new applications.

Related Information

The pthread_lock_global_np (pthread_lock_global_np Subroutine) subroutine.

Using Mutexes in AIX 5L Version 5.1 General Programming Concepts: Writing and Debugging Programs.

[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]