X-Git-Url: https://git.saurik.com/apple/libpthread.git/blobdiff_plain/3a6437e67ee23e43516c71ee42f674e6cfa9dc75..2546420a235d38941a7eed560a8cb61403ecb8e2:/man/pthread_cond_wait.3 diff --git a/man/pthread_cond_wait.3 b/man/pthread_cond_wait.3 index efe6ac2..2c57f56 100644 --- a/man/pthread_cond_wait.3 +++ b/man/pthread_cond_wait.3 @@ -26,49 +26,43 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $FreeBSD: src/lib/libc_r/man/pthread_cond_wait.3,v 1.8.2.4 2001/08/17 15:42:51 ru Exp $ +.\" $FreeBSD$ .\" -.Dd November 5, 2001 +.Dd February 16, 2006 .Dt PTHREAD_COND_WAIT 3 .Os Darwin .Sh NAME .Nm pthread_cond_wait .Nd wait on a condition variable .Sh SYNOPSIS -.Fd #include +.In pthread.h .Ft int -.Fo pthread_cond_wait -.Fa "pthread_cond_t *restrict cond" -.Fa "pthread_mutex_t *restrict mutex" -.Fc +.Fn pthread_cond_wait "pthread_cond_t *cond" "pthread_mutex_t *mutex" .Sh DESCRIPTION The .Fn pthread_cond_wait -function atomically unlocks the -.Fa mutex -and blocks the current thread on the condition specified by the -.Fa cond -argument. -The current thread unblocks only after another thread calls -.Xr pthread_cond_signal 3 +function atomically blocks the current thread waiting on the condition +variable specified by +.Fa cond , +and releases the mutex specified by +.Fa mutex . +The waiting thread unblocks only after another thread calls +.Xr pthread_cond_signal 3 , or .Xr pthread_cond_broadcast 3 -with the same condition variable. -The -.Fa mutex -must be locked before calling this function, otherwise the behavior is -undefined. Before -.Fn pthread_cond_wait -returns to the calling function, it re-acquires the +with the same condition variable, and the current thread reacquires the lock +on .Fa mutex . .Sh RETURN VALUES If successful, the .Fn pthread_cond_wait -function will return zero; otherwise, an error number will be returned to +function will return zero. +Otherwise an error number will be returned to indicate the error. .Sh ERRORS +The .Fn pthread_cond_wait -will fail if: +function will fail if: .Bl -tag -width Er .It Bq Er EINVAL The value specified by @@ -84,6 +78,7 @@ is invalid. .Xr pthread_cond_signal 3 , .Xr pthread_cond_timedwait 3 .Sh STANDARDS +The .Fn pthread_cond_wait -conforms to +function conforms to .St -p1003.1-96 .