pthread_spin_unlock.html 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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_SPIN_UNLOCK&quot;(P) manual page</TITLE>
  6. <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)">
  7. <META NAME="CREATED" CONTENT="20050505;12401400">
  8. <META NAME="CHANGED" CONTENT="20050505;12462400">
  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_spin_unlock - unlock a spin lock object (<B>ADVANCED
  18. REALTIME THREADS</B>)
  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_spin_unlock(pthread_spinlock_t *</B><I>lock</I><B>);
  24. </B>
  25. </P>
  26. <H2><A HREF="#toc2" NAME="sect2">Description</A></H2>
  27. <P>The <B>pthread_spin_unlock</B> function shall release the spin
  28. lock referenced by <I>lock</I> which was locked via the
  29. <A HREF="pthread_spin_lock.html"><B>pthread_spin_lock</B>(3)</A> or
  30. <A HREF="pthread_spin_lock.html"><B>pthread_spin_trylock</B>(3)</A>
  31. functions. If there are threads spinning on the lock when
  32. <B>pthread_spin_unlock</B> is called, the lock becomes available and
  33. an unspecified spinning thread shall acquire the lock.
  34. </P>
  35. <P><B>Pthreads-w32</B> does not check ownership of the lock and it is
  36. therefore possible for a thread other than the locker to unlock the
  37. spin lock. This is not a feature that should be exploited.</P>
  38. <P>The results are undefined if this function is called with an
  39. uninitialized thread spin lock.
  40. </P>
  41. <H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2>
  42. <P>Upon successful completion, the <B>pthread_spin_unlock</B>
  43. function shall return zero; otherwise, an error number shall be
  44. returned to indicate the error.
  45. </P>
  46. <H2><A HREF="#toc4" NAME="sect4">Errors</A></H2>
  47. <P>The <B>pthread_spin_unlock</B> function may fail if:
  48. </P>
  49. <DL>
  50. <DT><B>EINVAL</B>
  51. </DT><DD>
  52. An invalid argument was specified.
  53. </DD><DD STYLE="margin-left: -2cm">
  54. <BR>
  55. </DD></DL>
  56. <P>
  57. This function shall not return an error code of [EINTR].
  58. </P>
  59. <P><I>The following sections are informative.</I>
  60. </P>
  61. <H2><A HREF="#toc5" NAME="sect5">Examples</A></H2>
  62. <P>None.
  63. </P>
  64. <H2><A HREF="#toc6" NAME="sect6">Application Usage</A></H2>
  65. <P><B>Pthreads-w32</B> does not check ownership of the lock and it is
  66. therefore possible for a thread other than the locker to unlock the
  67. spin lock. This is not a feature that should be exploited.</P>
  68. <H2><A HREF="#toc7" NAME="sect7">Rationale</A></H2>
  69. <P>None.
  70. </P>
  71. <H2><A HREF="#toc8" NAME="sect8">Future Directions</A></H2>
  72. <P>None.
  73. </P>
  74. <H2><A HREF="#toc9" NAME="sect9">See Also</A></H2>
  75. <P><A HREF="pthread_spin_init.html"><B>pthread_spin_destroy</B>(3)</A>
  76. <B>,</B> <A HREF="pthread_spin_lock.html"><B>pthread_spin_lock</B>(3)</A>
  77. <B>,</B> the Base Definitions volume of IEEE&nbsp;Std&nbsp;1003.1-2001,
  78. <I>&lt;pthread.h&gt;</I>
  79. </P>
  80. <H2><A HREF="#toc10" NAME="sect10">Copyright</A></H2>
  81. <P>Portions of this text are reprinted and reproduced in electronic
  82. form from IEEE Std 1003.1, 2003 Edition, Standard for Information
  83. Technology -- Portable Operating System Interface (POSIX), The Open
  84. Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the
  85. Institute of Electrical and Electronics Engineers, Inc and The Open
  86. Group. In the event of any discrepancy between this version and the
  87. original IEEE and The Open Group Standard, the original IEEE and The
  88. Open Group Standard is the referee document. The original Standard
  89. can be obtained online at <A HREF="http://www.opengroup.org/unix/online.html">http://www.opengroup.org/unix/online.html</A>
  90. .
  91. </P>
  92. <P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P>
  93. <HR>
  94. <P><A NAME="toc"></A><B>Table of Contents</B></P>
  95. <UL>
  96. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A>
  97. </P>
  98. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A>
  99. </P>
  100. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A>
  101. </P>
  102. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return
  103. Value</A>
  104. </P>
  105. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A>
  106. </P>
  107. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Examples</A>
  108. </P>
  109. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">Application
  110. Usage</A>
  111. </P>
  112. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect7" NAME="toc7">Rationale</A>
  113. </P>
  114. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect8" NAME="toc8">Future
  115. Directions</A>
  116. </P>
  117. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect9" NAME="toc9">See
  118. Also</A>
  119. </P>
  120. <LI><P><A HREF="#sect10" NAME="toc10">Copyright</A>
  121. </P>
  122. </UL>
  123. </BODY>
  124. </HTML>