*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Tru64 Unix man pages -> pthread_lock_global_np (3)              
Title
Content
Arch
Section
 

pthread_lock_global_np(3)

Contents


NAME    [Toc]    [Back]

       pthread_lock_global_np - Locks the DECthreads global mutex

SYNOPSIS    [Toc]    [Back]

       #include <pthread.h>

       int pthread_lock_global_np(
               void );

LIBRARY    [Toc]    [Back]

       DECthreads POSIX 1003.1c Library (libpthread.so)

STANDARDS    [Toc]    [Back]

       None

PARAMETERS    [Toc]    [Back]

       None

DESCRIPTION    [Toc]    [Back]

       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 documentation 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    [Toc]    [Back]

       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    [Toc]    [Back]

       None






SEE ALSO    [Toc]    [Back]

      
      
       Functions: pthread_unlock_global_np(3)

       Manuals: Guide to DECthreads and Programmer's Guide



                                        pthread_lock_global_np(3)
[ Back ]
 Similar pages
Name OS Title
pthread_unlock_global_np Tru64 Unlocks the DECthreads global mutex
tis_unlock_global Tru64 Unlocks the DECthreads global mutex
tis_mutex_lock Tru64 Locks an unlocked mutex
pthread_mutex_lock Tru64 Locks an unlocked mutex
pthread_mutexattr_gettype Tru64 Obtains the mutex type attribute in the specified mutex attributes object
pthread_mutexattr_settype Tru64 Specifies the mutex type attribute that is used when a mutex is created
pthread_exc_matches_np Tru64 (Macro) Determines whether two DECthreads exception objects are identical
pthread_exc_report_np Tru64 Produces a message that reports what a specified DECthreads status exception object represents
pthread_exc_set_status_np Tru64 (Macro) Imports a systemdefined error status into a DECthreads address exception object
BUF_TIMELOCK FreeBSD locks a buffer
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service