logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

pthread_rwlock_unlock.3p (4203B)


  1. '\" et
  2. .TH PTHREAD_RWLOCK_UNLOCK "3P" 2017 "IEEE/The Open Group" "POSIX Programmer's Manual"
  3. .\"
  4. .SH PROLOG
  5. This manual page is part of the POSIX Programmer's Manual.
  6. The Linux implementation of this interface may differ (consult
  7. the corresponding Linux manual page for details of Linux behavior),
  8. or the interface may not be implemented on Linux.
  9. .\"
  10. .SH NAME
  11. pthread_rwlock_unlock
  12. \(em unlock a read-write lock object
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. #include <pthread.h>
  17. .P
  18. int pthread_rwlock_unlock(pthread_rwlock_t *\fIrwlock\fP);
  19. .fi
  20. .SH DESCRIPTION
  21. The
  22. \fIpthread_rwlock_unlock\fR()
  23. function shall release a lock held on the read-write lock object
  24. referenced by
  25. .IR rwlock .
  26. Results are undefined if the read-write lock
  27. .IR rwlock
  28. is not held by the calling thread.
  29. .P
  30. If this function is called to release a read lock from the read-write
  31. lock object and there are other read locks currently held on this
  32. read-write lock object, the read-write lock object remains in the read
  33. locked state. If this function releases the last read lock for this
  34. read-write lock object, the read-write lock object shall be put in the
  35. unlocked state with no owners.
  36. .P
  37. If this function is called to release a write lock for this read-write
  38. lock object, the read-write lock object shall be put in the unlocked
  39. state.
  40. .P
  41. If there are threads blocked on the lock when it becomes available, the
  42. scheduling policy shall determine which thread(s) shall acquire the
  43. lock.
  44. If the Thread Execution Scheduling option is supported, when threads
  45. executing with the scheduling policies SCHED_FIFO, SCHED_RR, or
  46. SCHED_SPORADIC are waiting on the lock, they shall acquire the lock in
  47. priority order when the lock becomes available. For equal priority
  48. threads, write locks shall take precedence over read locks.
  49. If the Thread Execution Scheduling option is not supported, it is
  50. implementation-defined whether write locks take precedence over read
  51. locks.
  52. .P
  53. Results are undefined if this function is called with an uninitialized
  54. read-write lock.
  55. .SH "RETURN VALUE"
  56. If successful, the
  57. \fIpthread_rwlock_unlock\fR()
  58. function shall return zero; otherwise, an error number shall be
  59. returned to indicate the error.
  60. .SH ERRORS
  61. The
  62. \fIpthread_rwlock_unlock\fR()
  63. function shall not return an error code of
  64. .BR [EINTR] .
  65. .LP
  66. .IR "The following sections are informative."
  67. .SH EXAMPLES
  68. None.
  69. .SH "APPLICATION USAGE"
  70. None.
  71. .SH RATIONALE
  72. If an implementation detects that the value specified by the
  73. .IR rwlock
  74. argument to
  75. \fIpthread_rwlock_unlock\fR()
  76. does not refer to an initialized read-write lock object, it is
  77. recommended that the function should fail and report an
  78. .BR [EINVAL]
  79. error.
  80. .P
  81. If an implementation detects that the value specified by the
  82. .IR rwlock
  83. argument to
  84. \fIpthread_rwlock_unlock\fR()
  85. refers to a read-write lock object for which the current thread does
  86. not hold a lock, it is recommended that the function should fail
  87. and report an
  88. .BR [EPERM]
  89. error.
  90. .SH "FUTURE DIRECTIONS"
  91. None.
  92. .SH "SEE ALSO"
  93. .ad l
  94. .IR "\fIpthread_rwlock_destroy\fR\^(\|)",
  95. .IR "\fIpthread_rwlock_rdlock\fR\^(\|)",
  96. .IR "\fIpthread_rwlock_timedrdlock\fR\^(\|)",
  97. .IR "\fIpthread_rwlock_timedwrlock\fR\^(\|)",
  98. .IR "\fIpthread_rwlock_trywrlock\fR\^(\|)"
  99. .ad b
  100. .P
  101. The Base Definitions volume of POSIX.1\(hy2017,
  102. .IR "Section 4.12" ", " "Memory Synchronization",
  103. .IR "\fB<pthread.h>\fP"
  104. .\"
  105. .SH COPYRIGHT
  106. Portions of this text are reprinted and reproduced in electronic form
  107. from IEEE Std 1003.1-2017, Standard for Information Technology
  108. -- Portable Operating System Interface (POSIX), The Open Group Base
  109. Specifications Issue 7, 2018 Edition,
  110. Copyright (C) 2018 by the Institute of
  111. Electrical and Electronics Engineers, Inc and The Open Group.
  112. In the event of any discrepancy between this version and the original IEEE and
  113. The Open Group Standard, the original IEEE and The Open Group Standard
  114. is the referee document. The original Standard can be obtained online at
  115. http://www.opengroup.org/unix/online.html .
  116. .PP
  117. Any typographical or formatting errors that appear
  118. in this page are most likely
  119. to have been introduced during the conversion of the source files to
  120. man page format. To report such errors, see
  121. https://www.kernel.org/doc/man-pages/reporting_bugs.html .