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_barrier_destroy.3p (5118B)


  1. '\" et
  2. .TH PTHREAD_BARRIER_DESTROY "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_barrier_destroy,
  12. pthread_barrier_init
  13. \(em destroy and initialize a barrier object
  14. .SH SYNOPSIS
  15. .LP
  16. .nf
  17. #include <pthread.h>
  18. .P
  19. int pthread_barrier_destroy(pthread_barrier_t *\fIbarrier\fP);
  20. int pthread_barrier_init(pthread_barrier_t *restrict \fIbarrier\fP,
  21. const pthread_barrierattr_t *restrict \fIattr\fP, unsigned \fIcount\fP);
  22. .fi
  23. .SH DESCRIPTION
  24. The
  25. \fIpthread_barrier_destroy\fR()
  26. function shall destroy the barrier referenced by
  27. .IR barrier
  28. and release any resources used by the barrier. The effect of
  29. subsequent use of the barrier is undefined until the barrier is
  30. reinitialized by another call to
  31. \fIpthread_barrier_init\fR().
  32. An implementation may use this function to set
  33. .IR barrier
  34. to an invalid value. The results are undefined if
  35. \fIpthread_barrier_destroy\fR()
  36. is called when any thread is blocked on the barrier, or if this
  37. function is called with an uninitialized barrier.
  38. .P
  39. The
  40. \fIpthread_barrier_init\fR()
  41. function shall allocate any resources required to use the barrier
  42. referenced by
  43. .IR barrier
  44. and shall initialize the barrier with attributes referenced by
  45. .IR attr .
  46. If
  47. .IR attr
  48. is NULL, the default barrier attributes shall be used; the effect is
  49. the same as passing the address of a default barrier attributes
  50. object. The results are undefined if
  51. \fIpthread_barrier_init\fR()
  52. is called when any thread is blocked on the barrier (that is, has not
  53. returned from the
  54. \fIpthread_barrier_wait\fR()
  55. call). The results are undefined if a barrier is used without first
  56. being initialized. The results are undefined if
  57. \fIpthread_barrier_init\fR()
  58. is called specifying an already initialized barrier.
  59. .P
  60. The
  61. .IR count
  62. argument specifies the number of threads that must call
  63. \fIpthread_barrier_wait\fR()
  64. before any of them successfully return from the call. The value
  65. specified by
  66. .IR count
  67. must be greater than zero.
  68. .P
  69. If the
  70. \fIpthread_barrier_init\fR()
  71. function fails, the barrier shall not be initialized and the contents
  72. of
  73. .IR barrier
  74. are undefined.
  75. .P
  76. See
  77. .IR "Section 2.9.9" ", " "Synchronization Object Copies and Alternative Mappings"
  78. for further requirements.
  79. .SH "RETURN VALUE"
  80. Upon successful completion, these functions shall return zero;
  81. otherwise, an error number shall be returned to indicate the error.
  82. .SH ERRORS
  83. The
  84. \fIpthread_barrier_init\fR()
  85. function shall fail if:
  86. .TP
  87. .BR EAGAIN
  88. The system lacks the necessary resources to initialize another barrier.
  89. .TP
  90. .BR EINVAL
  91. The value specified by
  92. .IR count
  93. is equal to zero.
  94. .TP
  95. .BR ENOMEM
  96. Insufficient memory exists to initialize the barrier.
  97. .P
  98. These functions shall not return an error code of
  99. .BR [EINTR] .
  100. .LP
  101. .IR "The following sections are informative."
  102. .SH EXAMPLES
  103. None.
  104. .SH "APPLICATION USAGE"
  105. None.
  106. .SH RATIONALE
  107. If an implementation detects that the value specified by the
  108. .IR barrier
  109. argument to
  110. \fIpthread_barrier_destroy\fR()
  111. does not refer to an initialized barrier object, it is recommended that
  112. the function should fail and report an
  113. .BR [EINVAL]
  114. error.
  115. .P
  116. If an implementation detects that the value specified by the
  117. .IR attr
  118. argument to
  119. \fIpthread_barrier_init\fR()
  120. does not refer to an initialized barrier attributes object, it is
  121. recommended that the function should fail and report an
  122. .BR [EINVAL]
  123. error.
  124. .P
  125. If an implementation detects that the value specified by the
  126. .IR barrier
  127. argument to
  128. \fIpthread_barrier_destroy\fR()
  129. or
  130. \fIpthread_barrier_init\fR()
  131. refers to a barrier that is in use (for example, in a
  132. \fIpthread_barrier_wait\fR()
  133. call) by another thread, or detects that the value specified by the
  134. .IR barrier
  135. argument to
  136. \fIpthread_barrier_init\fR()
  137. refers to an already initialized barrier object, it is recommended
  138. that the function should fail and report an
  139. .BR [EBUSY]
  140. error.
  141. .SH "FUTURE DIRECTIONS"
  142. None.
  143. .SH "SEE ALSO"
  144. .IR "\fIpthread_barrier_wait\fR\^(\|)"
  145. .P
  146. The Base Definitions volume of POSIX.1\(hy2017,
  147. .IR "\fB<pthread.h>\fP"
  148. .\"
  149. .SH COPYRIGHT
  150. Portions of this text are reprinted and reproduced in electronic form
  151. from IEEE Std 1003.1-2017, Standard for Information Technology
  152. -- Portable Operating System Interface (POSIX), The Open Group Base
  153. Specifications Issue 7, 2018 Edition,
  154. Copyright (C) 2018 by the Institute of
  155. Electrical and Electronics Engineers, Inc and The Open Group.
  156. In the event of any discrepancy between this version and the original IEEE and
  157. The Open Group Standard, the original IEEE and The Open Group Standard
  158. is the referee document. The original Standard can be obtained online at
  159. http://www.opengroup.org/unix/online.html .
  160. .PP
  161. Any typographical or formatting errors that appear
  162. in this page are most likely
  163. to have been introduced during the conversion of the source files to
  164. man page format. To report such errors, see
  165. https://www.kernel.org/doc/man-pages/reporting_bugs.html .