1PTHREAD_RWLOCK_UNLOCK(3P)  POSIX Programmer's Manual PTHREAD_RWLOCK_UNLOCK(3P)
2
3
4

PROLOG

6       This  manual  page is part of the POSIX Programmer's Manual.  The Linux
7       implementation of this interface may differ (consult the  corresponding
8       Linux  manual page for details of Linux behavior), or the interface may
9       not be implemented on Linux.
10

NAME

12       pthread_rwlock_unlock - unlock a read-write lock object
13

SYNOPSIS

15       #include <pthread.h>
16
17       int pthread_rwlock_unlock(pthread_rwlock_t *rwlock);
18
19

DESCRIPTION

21       The pthread_rwlock_unlock() function shall release a lock held  on  the
22       read-write  lock object referenced by rwlock.  Results are undefined if
23       the read-write lock rwlock is not held by the calling thread.
24
25       If this function is called to release a read lock from  the  read-write
26       lock object and there are other read locks currently held on this read-
27       write lock object, the read-write  lock  object  remains  in  the  read
28       locked  state.  If  this  function releases the last read lock for this
29       read-write lock object, the read-write lock object shall be put in  the
30       unlocked state with no owners.
31
32       If  this function is called to release a write lock for this read-write
33       lock object, the read-write lock object shall be put  in  the  unlocked
34       state.
35
36       If there are threads blocked on the lock when it becomes available, the
37       scheduling policy shall determine which  thread(s)  shall  acquire  the
38       lock.   If  the  Thread  Execution Scheduling option is supported, when
39       threads executing with the scheduling policies SCHED_FIFO, SCHED_RR, or
40       SCHED_SPORADIC  are waiting on the lock, they shall acquire the lock in
41       priority order when the lock  becomes  available.  For  equal  priority
42       threads,  write  locks  shall  take precedence over read locks.  If the
43       Thread Execution Scheduling option is not supported, it is  implementa‐
44       tion-defined whether write locks take precedence over read locks.
45
46       Results  are  undefined  if  any  of these functions are called with an
47       uninitialized read-write lock.
48

RETURN VALUE

50       If successful, the pthread_rwlock_unlock() function shall return  zero;
51       otherwise, an error number shall be returned to indicate the error.
52

ERRORS

54       The pthread_rwlock_unlock() function may fail if:
55
56       EINVAL The  value  specified by rwlock does not refer to an initialized
57              read-write lock object.
58
59       EPERM  The current thread does not hold a lock on the read-write lock.
60
61
62       The pthread_rwlock_unlock() function shall not return an error code  of
63       [EINTR].
64
65       The following sections are informative.
66

EXAMPLES

68       None.
69

APPLICATION USAGE

71       None.
72

RATIONALE

74       None.
75

FUTURE DIRECTIONS

77       None.
78

SEE ALSO

80       pthread_rwlock_destroy(), pthread_rwlock_rdlock(), pthread_rwlock_time‐
81       drdlock(),  pthread_rwlock_timedwrlock(),   pthread_rwlock_tryrdlock(),
82       pthread_rwlock_trywrlock(),  pthread_rwlock_wrlock(),  the Base Defini‐
83       tions volume of IEEE Std 1003.1-2001, <pthread.h>
84
86       Portions of this text are reprinted and reproduced in  electronic  form
87       from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
88       -- Portable Operating System Interface (POSIX),  The  Open  Group  Base
89       Specifications  Issue  6,  Copyright  (C) 2001-2003 by the Institute of
90       Electrical and Electronics Engineers, Inc and The Open  Group.  In  the
91       event of any discrepancy between this version and the original IEEE and
92       The Open Group Standard, the original IEEE and The Open Group  Standard
93       is  the  referee document. The original Standard can be obtained online
94       at http://www.opengroup.org/unix/online.html .
95
96
97
98IEEE/The Open Group                  2003            PTHREAD_RWLOCK_UNLOCK(3P)
Impressum