pthread_condattr_init.html 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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>PTHREAD_CONDATTR(3) manual page</TITLE>
  6. <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)">
  7. <META NAME="CREATED" CONTENT="20050504;16375600">
  8. <META NAME="CHANGED" CONTENT="20050504;16570300">
  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_condattr_init, pthread_condattr_destroy - condition
  18. creation
  19. </P>
  20. <P>attributes
  21. </P>
  22. <H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2>
  23. <P><B>#include &lt;pthread.h&gt;</B>
  24. </P>
  25. <P><B>int pthread_condattr_init(pthread_condattr_t *</B><I>attr</I><B>);</B>
  26. </P>
  27. <P><B>int pthread_condattr_destroy(pthread_condattr_t *</B><I>attr</I><B>);</B>
  28. </P>
  29. <H2><A HREF="#toc2" NAME="sect2">Description</A></H2>
  30. <P>Condition attributes can be specified at condition creation time,
  31. by passing a condition attribute object as second argument to
  32. <A HREF="pthread_cond_init.html"><B>pthread_cond_init</B>(3)</A> .
  33. Passing <B>NULL</B> is equivalent to passing a condition attribute
  34. object with all attributes set to their default values.
  35. </P>
  36. <P><B>pthread_condattr_init</B> initializes the condition attribute
  37. object <I>attr</I> and fills it with default values for the
  38. attributes. <B>pthread_condattr_destroy</B> destroys a condition
  39. attribute object, which must not be reused until it is reinitialized.</P>
  40. <P><B>Pthreads-w32</B> defines _<B>POSIX_THREAD_PROCESS_SHARED</B> in
  41. pthread.h as -1 to indicate that the attribute routines are
  42. implemented but that the process shared attribute is not supported.</P>
  43. <H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2>
  44. <P>All condition variable functions return 0 on success and a
  45. non-zero error code on error.</P>
  46. <H2><A HREF="#toc4" NAME="sect4">Errors</A></H2>
  47. <P>The <B>pthread_condattr_init</B> function returns the following
  48. error code on error:
  49. </P>
  50. <DL>
  51. <DL>
  52. <DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>ENOMEM</B>
  53. </DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm">
  54. The was insufficient memory to create the attribute.<SPAN STYLE="font-weight: medium">
  55. </SPAN>
  56. </DD></DL>
  57. </DL>
  58. <P>
  59. The <B>pthread_condattr_destroy</B> function returns the following
  60. error code on error:
  61. </P>
  62. <DL>
  63. <DL>
  64. <DT STYLE="margin-right: 1cm; margin-bottom: 0.5cm"><B>EINVAL</B>
  65. </DT><DD STYLE="margin-right: 1cm; margin-bottom: 0.5cm">
  66. The <I>attr</I> argument is not valid.<SPAN STYLE="font-weight: medium">
  67. </SPAN>
  68. </DD></DL>
  69. </DL>
  70. <H2>
  71. <A HREF="#toc5" NAME="sect5">Author</A></H2>
  72. <P>Xavier Leroy &lt;[email protected]&gt;
  73. </P>
  74. <P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P>
  75. <H2><A HREF="#toc6" NAME="sect6">See Also</A></H2>
  76. <P><A HREF="pthread_cond_init.html"><B>pthread_cond_init</B>(3)</A> .
  77. </P>
  78. <HR>
  79. <P><A NAME="toc"></A><B>Table of Contents</B></P>
  80. <UL>
  81. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A>
  82. </P>
  83. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A>
  84. </P>
  85. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A>
  86. </P>
  87. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return
  88. Value</A>
  89. </P>
  90. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A>
  91. </P>
  92. <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Author</A>
  93. </P>
  94. <LI><P><A HREF="#sect6" NAME="toc6">See Also</A>
  95. </P>
  96. </UL>
  97. </BODY>
  98. </HTML>