diff options
| author | ad <ad@NetBSD.org> | 2008-05-26 02:16:48 +0000 |
|---|---|---|
| committer | ad <ad@NetBSD.org> | 2008-05-26 02:16:48 +0000 |
| commit | 3ad4fb52340c1dbf99bf7dbacfaf80352b0fba5d (patch) | |
| tree | c511cdec520f1fa99922fa4dcc12d8dc05574a81 /lib/libpthread | |
| parent | 2dad86041d1c177dc9d5fca390e7c78ba529a1b9 (diff) | |
Note that when calling pthread_cond_broadcast/signal, the same mutex as
passed to wait/timedwait must be held.
Diffstat (limited to 'lib/libpthread')
| -rw-r--r-- | lib/libpthread/pthread_cond_broadcast.3 | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/lib/libpthread/pthread_cond_broadcast.3 b/lib/libpthread/pthread_cond_broadcast.3 index 71c5e4240ef..5529354af22 100644 --- a/lib/libpthread/pthread_cond_broadcast.3 +++ b/lib/libpthread/pthread_cond_broadcast.3 @@ -1,6 +1,6 @@ -.\" $NetBSD: pthread_cond_broadcast.3,v 1.5 2008/05/04 19:43:05 martin Exp $ +.\" $NetBSD: pthread_cond_broadcast.3,v 1.6 2008/05/26 02:16:48 ad Exp $ .\" -.\" Copyright (c) 2002 The NetBSD Foundation, Inc. +.\" Copyright (c) 2002, 2008 The NetBSD Foundation, Inc. .\" All rights reserved. .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -51,7 +51,7 @@ .\" .\" $FreeBSD: src/lib/libpthread/man/pthread_cond_broadcast.3,v 1.11 2002/09/16 19:29:28 mini Exp $ .\" -.Dd January 30, 2003 +.Dd May 26, 2008 .Dt PTHREAD_COND_BROADCAST 3 .Os .Sh NAME @@ -86,6 +86,21 @@ If no threads are waiting on the .Fn pthread_cond_signal function has no effect. +.Pp +When calling +.Fn pthread_cond_wait +and/or +.Fn pthread_cond_timedwait , +a temporary binding is established between the condition variable +.Fa cond +and a caller-supplied mutex. +.Pp +The same mutex must be held while calling +.Fn pthread_cond_broadcast +and +.Fn pthread_cond_signal . +Neither function enforces this requirement, but if the mutex is not +held the resulting behaviour is undefined. .Sh RETURN VALUES If successful, the .Fn pthread_cond_broadcast |
