'\" te .\" Copyright (c) 1995 Sun Microsystems, Inc. All Rights Reserved. .TH _lwp_cond_signal 2 "8 Dec 1995" "SunOS 5.11" "System Calls" .SH NAME _lwp_cond_signal, _lwp_cond_broadcast \- signal a condition variable .SH SYNOPSIS .LP .nf #include \fBint\fR \fB_lwp_cond_signal\fR(\fBlwp_cond_t *\fR\fIcvp\fR); .fi .LP .nf \fBint\fR \fB_lwp_cond_broadcast\fR(\fBlwp_cond_t *\fR\fIcvp\fR); .fi .SH DESCRIPTION .sp .LP The \fB_lwp_cond_signal()\fR function unblocks one LWP that is blocked on the LWP condition variable pointed to by \fIcvp\fR. .sp .LP The \fB_lwp_cond_broadcast()\fR function unblocks all LWPs that are blocked on the LWP condition variable pointed to by \fIcvp\fR. .sp .LP If no LWPs are blocked on the LWP condition variable, then \fB_lwp_cond_signal()\fR and \fB_lwp_cond_broadcast()\fR have no effect. .sp .LP 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 \fB_lwp_cond_wait()\fR. This can cause an infinite wait. .SH RETURN VALUES .sp .LP Upon successful completion, \fB0\fR is returned. A non-zero value indicates an error. .SH ERRORS .sp .LP The \fB_lwp_cond_signal()\fR and \fB_lwp_cond_broadcast()\fR functions will fail if: .sp .ne 2 .mk .na \fB\fBEINVAL\fR\fR .ad .RS 10n .rt The \fIcvp\fR argument points to an invalid LWP condition variable. .RE .sp .ne 2 .mk .na \fB\fBEFAULT\fR\fR .ad .RS 10n .rt The \fIcvp\fR argument points to an invalid address. .RE .SH SEE ALSO .sp .LP \fB_lwp_cond_wait\fR(2), \fB_lwp_mutex_lock\fR(2)