~ubuntu-branches/ubuntu/feisty/clamav/feisty

« back to all changes in this revision

Viewing changes to win32/3rdparty/pthreads/manual/pthread_barrier_init.html

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook
  • Date: 2007-02-20 10:33:44 UTC
  • mto: This revision was merged to the branch mainline in revision 16.
  • Revision ID: james.westby@ubuntu.com-20070220103344-zgcu2psnx9d98fpa
Tags: upstream-0.90
Import upstream version 0.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
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_BARRIER_DESTROY&quot;(P) manual page</TITLE>
6
 
        <META NAME="GENERATOR" CONTENT="OpenOffice.org 2.0  (Linux)">
7
 
        <META NAME="CREATED" CONTENT="20050504;11372800">
8
 
        <META NAME="CHANGEDBY" CONTENT="Ross Johnson">
9
 
        <META NAME="CHANGED" CONTENT="20060408;9450100">
10
 
        <!-- manual page source format generated by PolyglotMan v3.2, -->
11
 
        <!-- available at http://polyglotman.sourceforge.net/ -->
12
 
</HEAD>
13
 
<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR">
14
 
<H4>POSIX Threads for Windows – REFERENCE - <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A></H4>
15
 
<P><A HREF="index.html">Reference Index</A></P>
16
 
<P><A HREF="#toc">Table of Contents</A></P>
17
 
<H2><A HREF="#toc0" NAME="sect0">Name</A></H2>
18
 
<P>pthread_barrier_destroy, pthread_barrier_init - destroy and
19
 
initialize a barrier object (<B>ADVANCED REALTIME THREADS</B>) 
20
 
</P>
21
 
<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2>
22
 
<P><B>#include &lt;pthread.h&gt; </B>
23
 
</P>
24
 
<P><B>int pthread_barrier_destroy(pthread_barrier_t *</B><I>barrier</I><B>);
25
 
<BR>int pthread_barrier_init(pthread_barrier_t *restrict</B> <I>barrier</I><B>,
26
 
const pthread_barrierattr_t *restrict</B> <I>attr</I><B>, unsigned</B>
27
 
<I>count</I><B>); </B>
28
 
</P>
29
 
<H2><A HREF="#toc2" NAME="sect2">Description</A></H2>
30
 
<P>The <B>pthread_barrier_destroy</B> function shall destroy the
31
 
barrier referenced by <I>barrier</I> and release any resources used
32
 
by the barrier. The effect of subsequent use of the barrier is
33
 
undefined until the barrier is reinitialized by another call to
34
 
<B>pthread_barrier_init</B> . An implementation may use this function
35
 
to set <I>barrier</I> to an invalid value. The results are undefined
36
 
if <B>pthread_barrier_destroy</B> is called when any thread is
37
 
blocked on the barrier, or if this function is called with an
38
 
uninitialized barrier. 
39
 
</P>
40
 
<P>The <B>pthread_barrier_init</B> function shall allocate any
41
 
resources required to use the barrier referenced by <I>barrier</I>
42
 
and shall initialize the barrier with attributes referenced by <I>attr</I>.
43
 
If <I>attr</I> is NULL, the default barrier attributes shall be used;
44
 
the effect is the same as passing the address of a default barrier
45
 
attributes object. The results are undefined if <B>pthread_barrier_init</B>
46
 
is called when any thread is blocked on the barrier (that is, has not
47
 
returned from the <A HREF="pthread_barrier_wait.html"><B>pthread_barrier_wait</B>(3)</A>
48
 
call). The results are undefined if a barrier is used without first
49
 
being initialized. The results are undefined if <B>pthread_barrier_init</B>
50
 
is called specifying an already initialized barrier. 
51
 
</P>
52
 
<P>The <I>count</I> argument specifies the number of threads that
53
 
must call <A HREF="pthread_barrier_wait.html"><B>pthread_barrier_wait</B>(3)</A>
54
 
before any of them successfully return from the call. The value
55
 
specified by <I>count</I> must be greater than zero. 
56
 
</P>
57
 
<P>If the <B>pthread_barrier_init</B> function fails, the barrier
58
 
shall not be initialized and the contents of <I>barrier</I> are
59
 
undefined. 
60
 
</P>
61
 
<P>Only the object referenced by <I>barrier</I> may be used for
62
 
performing synchronization. The result of referring to copies of that
63
 
object in calls to <B>pthread_barrier_destroy</B> <B>or</B>
64
 
<A HREF="pthread_barrier_wait.html"><B>pthread_barrier_wait</B>(3)</A>
65
 
is undefined.</P>
66
 
<H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2>
67
 
<P>Upon successful completion, these functions shall return zero;
68
 
otherwise, an error number shall be returned to indicate the error. 
69
 
</P>
70
 
<H2><A HREF="#toc4" NAME="sect4">Errors</A></H2>
71
 
<P>The <B>pthread_barrier_destroy</B> function may fail if: 
72
 
</P>
73
 
<DL>
74
 
        <DT><B>EBUSY</B> 
75
 
        </DT><DD>
76
 
        The implementation has detected an attempt to destroy a barrier
77
 
        while it is in use (for example, while being used in a
78
 
        <A HREF="pthread_barrier_wait.html"><B>pthread_barrier_wait</B>(3)</A>
79
 
        call) by another thread. 
80
 
        </DD><DT>
81
 
        <B>EINVAL</B> 
82
 
        </DT><DD STYLE="margin-bottom: 0.5cm">
83
 
        The value specified by <I>barrier</I> is invalid. 
84
 
        </DD></DL>
85
 
<P>
86
 
The <B>pthread_barrier_init</B> function shall fail if: 
87
 
</P>
88
 
<DL>
89
 
        <DT><B>EAGAIN</B> 
90
 
        </DT><DD>
91
 
        The system lacks the necessary resources to initialize another
92
 
        barrier. 
93
 
        </DD><DT>
94
 
        <B>EINVAL</B> 
95
 
        </DT><DD>
96
 
        The value specified by <I>count</I> is equal to zero. 
97
 
        </DD><DT>
98
 
        <B>ENOMEM</B> 
99
 
        </DT><DD STYLE="margin-bottom: 0.5cm">
100
 
        Insufficient memory exists to initialize the barrier. 
101
 
        </DD></DL>
102
 
<P>
103
 
The <B>pthread_barrier_init</B> function may fail if: 
104
 
</P>
105
 
<DL>
106
 
        <DT><B>EBUSY</B> 
107
 
        </DT><DD>
108
 
        The implementation has detected an attempt to reinitialize a barrier
109
 
        while it is in use (for example, while being used in a
110
 
        <A HREF="pthread_barrier_wait.html"><B>pthread_barrier_wait</B>(3)</A>
111
 
        call) by another thread. 
112
 
        </DD><DT>
113
 
        <B>EINVAL</B> 
114
 
        </DT><DD STYLE="margin-bottom: 0.5cm">
115
 
        The value specified by <I>attr</I> is invalid. 
116
 
        </DD></DL>
117
 
<P>
118
 
These functions shall not return an error code of [EINTR]. 
119
 
</P>
120
 
<P><I>The following sections are informative.</I> 
121
 
</P>
122
 
<H2><A HREF="#toc5" NAME="sect5">Examples</A></H2>
123
 
<P>None. 
124
 
</P>
125
 
<H2><A HREF="#toc6" NAME="sect6">Application Usage</A></H2>
126
 
<P>The <B>pthread_barrier_destroy</B> and <B>pthread_barrier_init</B>
127
 
functions are part of the Barriers option and need not be provided on
128
 
all implementations. 
129
 
</P>
130
 
<P><B>Pthreads-w32</B> defines <B>_POSIX_BARRIERS</B> to indicate
131
 
that these routines are implemented and may be used.</P>
132
 
<H2><A HREF="#toc7" NAME="sect7">Rationale</A></H2>
133
 
<P>None. 
134
 
</P>
135
 
<H2><A HREF="#toc8" NAME="sect8">Future Directions</A></H2>
136
 
<P>None. 
137
 
</P>
138
 
<H2><A HREF="#toc11" NAME="sect11">Known Bugs</A></H2>
139
 
<DL>
140
 
        <DD STYLE="margin-left: 0cm; margin-bottom: 0.5cm">In
141
 
        <B><SPAN LANG="en-GB"><SPAN LANG="en-GB">pthreads-win32</SPAN></SPAN></B>,
142
 
        <A HREF="pthread_barrier_wait.html"></A><A HREF="pthread_barrier_wait.html"><B>pthread_barrier_wait</B>(3)</A><A HREF="pthread_barrier_wait.html"></A>
143
 
        may deadlock if the number of running threads able to wait on the
144
 
        barrier object exceeds the value given as the <I><SPAN LANG="en-GB"><SPAN LANG="en-GB">count</SPAN></SPAN></I>
145
 
        parameter in <B>pthread_barrier_init</B>. 
146
 
        </DD></DL>
147
 
<H2>
148
 
<A HREF="#toc9" NAME="sect9">See Also</A></H2>
149
 
<P><A HREF="pthread_barrier_wait.html"><B>pthread_barrier_wait</B>(3)</A>
150
 
<B>,</B> the Base Definitions volume of IEEE&nbsp;Std&nbsp;1003.1-2001,
151
 
<I>&lt;pthread.h&gt;</I> 
152
 
</P>
153
 
<H2><A HREF="#toc10" NAME="sect10">Copyright</A></H2>
154
 
<P>Portions of this text are reprinted and reproduced in electronic
155
 
form from IEEE Std 1003.1, 2003 Edition, Standard for Information
156
 
Technology -- Portable Operating System Interface (POSIX), The Open
157
 
Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the
158
 
Institute of Electrical and Electronics Engineers, Inc and The Open
159
 
Group. In the event of any discrepancy between this version and the
160
 
original IEEE and The Open Group Standard, the original IEEE and The
161
 
Open Group Standard is the referee document. The original Standard
162
 
can be obtained online at <A HREF="http://www.opengroup.org/unix/online.html">http://www.opengroup.org/unix/online.html</A>
163
 
164
 
</P>
165
 
<P>Modified by Ross Johnson for use with <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A>.</P>
166
 
<HR>
167
 
<P><A NAME="toc"></A><B>Table of Contents</B></P>
168
 
<UL>
169
 
        <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A>
170
 
                </P>
171
 
        <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A>
172
 
                </P>
173
 
        <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A>
174
 
                </P>
175
 
        <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return
176
 
        Value</A> 
177
 
        </P>
178
 
        <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A>
179
 
                </P>
180
 
        <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Examples</A>
181
 
                </P>
182
 
        <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect6" NAME="toc6">Application
183
 
        Usage</A> 
184
 
        </P>
185
 
        <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect7" NAME="toc7">Rationale</A>
186
 
                </P>
187
 
        <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect8" NAME="toc8">Future
188
 
        Directions</A> 
189
 
        </P>
190
 
        <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect11" NAME="toc11">Known
191
 
        Bugs</A> 
192
 
        </P>
193
 
        <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect9" NAME="toc9">See
194
 
        Also</A> 
195
 
        </P>
196
 
        <LI><P><A HREF="#sect10" NAME="toc10">Copyright</A> 
197
 
        </P>
198
 
</UL>
199
 
</BODY>
200
 
</HTML>
 
 
b'\\ No newline at end of file'