pthread_rwlockattr_init.html 5.7 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_RWLOCKATTR_DESTROY&quot;(P) manual page</TITLE>
  6. <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)">
  7. <META NAME="CREATED" CONTENT="20050505;504000">
  8. <META NAME="CHANGED" CONTENT="20050505;18474200">
  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_rwlockattr_destroy, pthread_rwlockattr_init - destroy and
  18. initialize the read-write lock attributes object
  19. </P>
  20. <H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2>
  21. <P><B>#include &lt;pthread.h&gt; </B>
  22. </P>
  23. <P><B>int pthread_rwlockattr_destroy(pthread_rwlockattr_t <I>*</I></B><I>attr</I><B>);
  24. <BR>int pthread_rwlockattr_init(pthread_rwlockattr_t <I>*</I></B><I>attr</I><B>);
  25. </B>
  26. </P>
  27. <H2><A HREF="#toc2" NAME="sect2">Description</A></H2>
  28. <P>The <B>pthread_rwlockattr_destroy</B> function shall destroy a
  29. read-write lock attributes object. A destroyed <I>attr</I> attributes
  30. object can be reinitialized using <B>pthread_rwlockattr_init</B> ;
  31. the results of otherwise referencing the object after it has been
  32. destroyed are undefined. An implementation may cause
  33. <B>pthread_rwlockattr_destroy</B> to set the object referenced by
  34. <I>attr</I> to an invalid value.
  35. </P>
  36. <P>The <B>pthread_rwlockattr_init</B> function shall initialize a
  37. read-write lock attributes object <I>attr</I> with the default value
  38. for all of the attributes defined by the implementation.
  39. </P>
  40. <P>Results are undefined if <B>pthread_rwlockattr_init</B> is called
  41. specifying an already initialized <I>attr</I> attributes object.
  42. </P>
  43. <P>After a read-write lock attributes object has been used to
  44. initialize one or more read-write locks, any function affecting the
  45. attributes object (including destruction) shall not affect any
  46. previously initialized read-write locks.
  47. </P>
  48. <P><B>Pthreads-w32</B> defines <B>_POSIX_READER_WRITER_LOCKS</B> in
  49. pthread.h as 200112L to indicate that the reader/writer routines are
  50. implemented and may be used.</P>
  51. <H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2>
  52. <P>If successful, the <B>pthread_rwlockattr_destroy</B> and
  53. <B>pthread_rwlockattr_init</B> functions shall return zero;
  54. otherwise, an error number shall be returned to indicate the error.
  55. </P>
  56. <H2><A HREF="#toc4" NAME="sect4">Errors</A></H2>
  57. <P>The <B>pthread_rwlockattr_destroy</B> function may fail if:
  58. </P>
  59. <DL>
  60. <DT><B>EINVAL</B>
  61. </DT><DD STYLE="margin-bottom: 0.5cm">
  62. The value specified by <I>attr</I> is invalid.
  63. </DD></DL>
  64. <P>
  65. The <B>pthread_rwlockattr_init</B> function shall fail if:
  66. </P>
  67. <DL>
  68. <DT><B>ENOMEM</B>
  69. </DT><DD STYLE="margin-bottom: 0.5cm">
  70. Insufficient memory exists to initialize the read-write lock
  71. attributes object.
  72. </DD></DL>
  73. <P>
  74. These functions shall not return an error code of [EINTR].
  75. </P>
  76. <P><I>The following sections are informative.</I>
  77. </P>
  78. <H2><A HREF="#toc5" NAME="sect5">Examples</A></H2>
  79. <P>None.
  80. </P>
  81. <H2><A HREF="#toc6" NAME="sect6">Application Usage</A></H2>
  82. <P>None.
  83. </P>
  84. <H2><A HREF="#toc7" NAME="sect7">Rationale</A></H2>
  85. <P>None.
  86. </P>
  87. <H2><A HREF="#toc8" NAME="sect8">Future Directions</A></H2>
  88. <P>None.
  89. </P>
  90. <H2><A HREF="#toc9" NAME="sect9">See Also</A></H2>
  91. <P><A HREF="pthread_rwlock_init.html"><B>pthread_rwlock_destroy</B>(3)</A>
  92. <B>,</B> <A HREF="pthread_rwlockattr_setpshared.html"><B>pthread_rwlockattr_getpshared</B>(3)</A>
  93. <B>,</B> <A HREF="pthread_rwlockattr_setpshared.html"><B>pthread_rwlockattr_setpshared</B>(3)</A>
  94. <B>,</B> 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>