Copyright (c) 1995 Sun Microsystems, Inc. All Rights Reserved.
The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
#include <sys/lwp.h> int _lwp_cond_signal(lwp_cond_t *cvp);
int _lwp_cond_broadcast(lwp_cond_t *cvp);
The _lwp_cond_signal() function unblocks one LWP that is blocked on the LWP condition variable pointed to by cvp.
The _lwp_cond_broadcast() function unblocks all LWPs that are blocked on the LWP condition variable pointed to by cvp.
If no LWPs are blocked on the LWP condition variable, then _lwp_cond_signal() and _lwp_cond_broadcast() have no effect.
Both functions should be called under the protection of the same LWP mutex lock that is used with the LWP condition variable being signaled. Otherwise, the condition variable may be signalled between the test of the associated condition and blocking in _lwp_cond_wait(). This can cause an infinite wait.
Upon successful completion, 0 is returned. A non-zero value indicates an error.
The _lwp_cond_signal() and _lwp_cond_broadcast() functions will fail if:
EINVAL
The cvp argument points to an invalid LWP condition variable.
EFAULT
The cvp argument points to an invalid address.
_lwp_cond_wait(2), _lwp_mutex_lock(2)