RE: pthread_cond_wait always return EINVAL

[ Available lists | Index of freebsd-stable | Month of Mar 2000 | Week of 18 Mar 2000 | Raw email | View thread | Wrap long lines | Reply | Tag ]
From
David Schwartz <davids@webmaster.com>
Date
18 Mar 2000 19:32:04
Subject
RE: pthread_cond_wait always return EINVAL
Message-ID
000501bf9153$afc48bf0$021d85d1@youwant.to

In reply to

[ Hide this part ]
 
> void* ThreadMain(void* arg)
> {
> ....
> error = pthread_cond_wait(&gCond, &gMutex);
> ^
> error always = EINVAL (22). This is my very first call that
> uses gCond.
> }
>
> I printed out gCond, it looks good. Can someone tell me what I've
> done wrong? Thanks!

You forgot to lock the mutex and you forgot to check the condition before
waiting.

DS



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message



Elapsed time: 0.091 seconds