Note that when calling pthread_cond_broadcast/signal, the same mutex as
passed to wait/timedwait must be held.
This commit is contained in:
parent
2dad86041d
commit
3ad4fb5234
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user