summaryrefslogtreecommitdiffstats
path: root/lib/libthr/thread/thr_umtx.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libthr/thread/thr_umtx.c')
-rw-r--r--lib/libthr/thread/thr_umtx.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/libthr/thread/thr_umtx.c b/lib/libthr/thread/thr_umtx.c
index 8a8c908..9de346e 100644
--- a/lib/libthr/thread/thr_umtx.c
+++ b/lib/libthr/thread/thr_umtx.c
@@ -131,6 +131,8 @@ _thr_ucond_wait(struct ucond *cv, struct umutex *m,
int
_thr_ucond_signal(struct ucond *cv)
{
+ if (!cv->c_has_waiters)
+ return (0);
if (_umtx_op(cv, UMTX_OP_CV_SIGNAL, 0, NULL, NULL) == 0)
return (0);
return (errno);
@@ -139,6 +141,8 @@ _thr_ucond_signal(struct ucond *cv)
int
_thr_ucond_broadcast(struct ucond *cv)
{
+ if (!cv->c_has_waiters)
+ return (0);
if (_umtx_op(cv, UMTX_OP_CV_BROADCAST, 0, NULL, NULL) == 0)
return (0);
return (errno);
OpenPOWER on IntegriCloud