From owner-freebsd-stable Sat Mar 18 19:32: 4 2000 Delivered-To: freebsd-stable@freebsd.org Received: from shell.webmaster.com (mail.webmaster.com [209.133.28.73]) by hub.freebsd.org (Postfix) with ESMTP id 1111137B66F for ; Sat, 18 Mar 2000 19:32:02 -0800 (PST) (envelope-from davids@webmaster.com) Received: from whenever ([209.133.29.2]) by shell.webmaster.com (Post.Office MTA v3.5.3 release 223 ID# 0-12345L500S10000V35) with SMTP id com; Sat, 18 Mar 2000 19:32:00 -0800 From: "David Schwartz" To: , Subject: RE: pthread_cond_wait always return EINVAL Date: Sat, 18 Mar 2000 19:32:00 -0800 Message-ID: <000501bf9153$afc48bf0$021d85d1@youwant.to> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2377.0 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 In-reply-to: <38D44293.924C973E@prismedia.com> Importance: Normal Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > 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