pthread_rwlock_unlock.html 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <HTML>
  3. <HEAD>
  4. <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
  5. <TITLE>&quot;PTHREAD_RWLOCK_UNLOCK&quot;(P) manual page</TITLE>
  6. <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)">
  7. <META NAME="CREATED" CONTENT="20050505;11291100">
  8. <META NAME="CHANGED" CONTENT="20050505;12562700">
  9. <!-- manual page source format generated by PolyglotMan v3.2, -->
  10. <!-- available at http://polyglotman.sourceforge.net/ -->
  11. </HEAD>
  12. <BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR">
  13. <H4>POSIX Threads for Windows – REFERENCE - <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A></H4>
  14. <P><A HREF="index.html">Reference Index</A></P>
  15. <P><A HREF="#toc">Table of Contents</A></P>
  16. <H2><A HREF="#toc0" NAME="sect0">Name</A></H2>
  17. <P>pthread_rwlock_unlock - unlock a read-write lock object
  18. </P>
  19. <H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2>
  20. <P><B>#include &lt;pthread.h&gt; </B>
  21. </P>
  22. <P>in<B>t pthread_rwlock_unlock(pthread_rwlock_t <I>*</I></B><I>rwlock</I><B>);
  23. </B>
  24. </P>
  25. <H2><A HREF="#toc2" NAME="sect2">Description</A></H2>
  26. <P>The <B>pthread_rwlock_unlock</B> function shall release a lock
  27. held on the read-write lock object referenced by <I>rwlock</I>.
  28. Results are undefined if the read-write lock <I>rwlock</I> is not
  29. held by the calling thread.
  30. </P>
  31. <P>If this function is called to release a read lock from the
  32. read-write lock object and there are other read locks currently held
  33. on this read-write lock object, the read-write lock object remains in
  34. the read locked state. If this function releases the last read lock
  35. for this read-write lock object, the read-write lock object shall be
  36. put in the unlocked state with no owners.
  37. </P>
  38. <P>If this function is called to release a write lock for this
  39. read-write lock object, the read-write lock object shall be put in
  40. the unlocked state.
  41. </P>
  42. <P><B>Pthreads-win32</B> does not prefer either writers or readers in
  43. acquiring the lock – all threads enter a single prioritised FIFO
  44. queue. While this may not be optimally efficient for some
  45. applications, it does ensure that one type does not starve the other.</P>
  46. <P>Results are undefined if any of these functions are called with an
  47. uninitialized read-write lock.
  48. </P>
  49. <P><B>Pthreads-w32</B> defines <B>_POSIX_READER_WRITER_LOCKS</B> in
  50. pthread.h as 200112L to indicate that the reader/writer routines are
  51. implemented and may be used.</P>
  52. <H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2>
  53. <P>If successful, the <B>pthread_rwlock_unlock</B> function shall
  54. return zero; otherwise, an error number shall be returned to indicate
  55. the error.
  56. </P>
  57. <H2><A HREF="#toc4" NAME="sect4">Errors</A></H2>
  58. <P>The <B>pthread_rwlock_unlock</B> function may fail if:
  59. </P>
  60. <DL>
  61. <DT><B>EINVAL</B>
  62. </DT><DD>
  63. The value specified by <I>rwlock</I> does not refer to an
  64. initialized read-write lock object.
  65. </DD><DD STYLE="margin-left: 0cm; margin-bottom: 0.5cm">
  66. <BR><BR>
  67. </DD></DL>
  68. <P>
  69. The <B>pthread_rwlock_unlock</B> function shall not return an error
  70. code of [EINTR].
  71. </P>
  72. <P><I>The following sections are informative.</I>
  73. </P>
  74. <H2><A HREF="#toc5" NAME="sect5">Examples</A></H2>
  75. <P>None.
  76. </P>
  77. <H2><A HREF="#toc6" NAME="sect6">Application Usage</A></H2>
  78. <P>None.
  79. </P>
  80. <H2><A HREF="#toc7" NAME="sect7">Rationale</A></H2>
  81. <P>None.
  82. </P>
  83. <H2><A HREF="#toc8" NAME="sect8">Future Directions</A></H2>
  84. <P>None.
  85. </P>
  86. <H2><A HREF="#toc9" NAME="sect9">See Also</A></H2>
  87. <P><A HREF="pthread_rwlock_init.html"><B>pthread_rwlock_destroy</B>(3)</A>
  88. <B>,</B> <A HREF="pthread_rwlock_rdlock.html"><B>pthread_rwlock_rdlock</B>(3)</A>
  89. <B>,</B> <A HREF="pthread_rwlock_timedrdlock.html"><B>pthread_rwlock_timedrdlock</B>(3)</A>
  90. <B>,</B> <A HREF="pthread_rwlock_timedwrlock.html"><B>pthread_rwlock_timedwrlock</B>(3)</A>
  91. <B>,</B> <A HREF="pthread_rwlock_rdlock.html"><B>pthread_rwlock_tryrdlock</B>(3)</A>
  92. <B>,</B> <A HREF="pthread_rwlock_wrlock.html"><B>pthread_rwlock_trywrlock</B>(3)</A>
  93. <B>,</B> <A HREF="pthread_rwlock_wrlock.html"><B>pthread_rwlock_wrlock</B>(3)</A>
  94. , the Base Definitions volume of IEEE&nbsp;Std&nbsp;1003.1-2001,
  95. <I>&lt;pthread.h&gt;</I>
  96. </P>
  97. <H2><A HREF="#toc10" NAME="sect10">Copyright</A></H2>
  98. <P>Portions of this text are reprinted and reproduced in electronic
  99. form from IEEE Std 1003.1, 2003 Edition, Standard for Information
  100. Technology -- Portable Operating System Interface (POSIX), The Open
  101. Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the
  102. Institute of Electrical and Electronics Engineers, Inc and The Open
  103. Group. In the event of any discrepancy between this version and the
  104. original IEEE and The Open Group Standard, the original IEEE and The
  105. Open Group Standard is the referee document. The original Standard
  106. can be obtained online at <A HREF="http://www.opengroup.org/unix/online.html">http://www.opengroup.org/unix/online.html</A>
  107. .
  108. </P>
  109. <P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P>
  110. <HR>
  111. <P><A NAME="toc"></A><B>Table of Contents</B></P>
  112. <UL>
  113. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A>
  114. </P>
  115. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A>
  116. </P>
  117. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A>
  118. </P>
  119. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return
  120. Value</A>
  121. </P>
  122. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A>
  123. </P>
  124. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Examples</A>
  125. </P>
  126. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">Application
  127. Usage</A>
  128. </P>
  129. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect7" NAME="toc7">Rationale</A>
  130. </P>
  131. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect8" NAME="toc8">Future
  132. Directions</A>
  133. </P>
  134. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect9" NAME="toc9">See
  135. Also</A>
  136. </P>
  137. <LI><P><A HREF="#sect10" NAME="toc10">Copyright</A>
  138. </P>
  139. </UL>
  140. </BODY>
  141. </HTML>