Date: Sat, 18 Mar 2000 19:32:00 -0800 From: "David Schwartz" <davids@webmaster.com> To: <siewsim@prismedia.com>, <freebsd-stable@FreeBSD.ORG> Subject: RE: pthread_cond_wait always return EINVAL Message-ID: <000501bf9153$afc48bf0$021d85d1@youwant.to> In-Reply-To: <38D44293.924C973E@prismedia.com>
next in thread | previous in thread | raw e-mail | index | archive | help
> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?000501bf9153$afc48bf0$021d85d1>