From owner-freebsd-hackers Mon Feb 5 11:15:43 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from uberhacker.org (uberhacker.org [204.210.12.243]) by hub.freebsd.org (Postfix) with SMTP id 4FE8837B491 for ; Mon, 5 Feb 2001 11:15:26 -0800 (PST) Received: (qmail 73469 invoked by uid 1000); 5 Feb 2001 19:15:06 -0000 Date: Mon, 5 Feb 2001 11:15:06 -0800 From: "Paul D. Schmidt" To: Alfred Perlstein Cc: hackers@FreeBSD.ORG Subject: Re: known pthread bug? Message-ID: <20010205111506.A73450@uberhacker.org> References: <20010204232301.C30977@uberhacker.org> <20010205005937.M26076@fw.wintelcom.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010205005937.M26076@fw.wintelcom.net>; from bright@wintelcom.net on Mon, Feb 05, 2001 at 12:59:37AM -0800 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Mon, Feb 05, 2001 at 12:59:37AM -0800, Alfred Perlstein wrote: > * Paul D. Schmidt [010204 23:23] wrote: > > Are there currently any known bugs with pthread_mutex_init > > and pthread_cond_init returning 0, but pthread_cond_wait > > returning EINVAL nonetheless? > > Can you provide a code sample to replicate this and specify which > version of FreeBSD you're using? typedef struct cond_tag { long cond_id; char *name; pthread_mutex_t cond_mutex; pthread_cond_t sys_cond; } cond_t; void thread_cond_create(cond_t *cond) { pthread_cond_init(&cond->sys_cond, NULL); pthread_mutex_init(&cond->cond_mutex, NULL); } void thread_cond_wait(cond_t *cond) { pthread_cond_wait(&cond->sys_cond, &cond->cond_mutex); } pthread_cond_wait() is returning immediately with EINVAL, even though printf debugging tells me that both the pthread_(cond|mutex)_init functions returned 0 (which man tells me is success). This is on FreeBSD 4.2-RELEASE. -Paul -- Paul D. Schmidt | Coder / Sys Admin | Unbound Communications | http://www.unboundcom.com "The grass may actually be greener on the other side of the fence, but it still has to be mowed." --Anonymous To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message