From owner-freebsd-threads@FreeBSD.ORG Thu Mar 11 07:16:18 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EE25F16A4CE for ; Thu, 11 Mar 2004 07:16:18 -0800 (PST) Received: from mxfep02.bredband.com (mxfep02.bredband.com [195.54.107.73]) by mx1.FreeBSD.org (Postfix) with ESMTP id A981B43D2F for ; Thu, 11 Mar 2004 07:16:17 -0800 (PST) (envelope-from torger@ludd.luth.se) Received: ([213.115.124.33] [213.115.124.33]) by mxfep02.bredband.com with ESMTP <20040311151616.PYT13311.mxfep02.bredband.com@c-217c73d5.022-251-6c756c10.cust.bredbandsbolaget.se>; Thu, 11 Mar 2004 16:16:16 +0100 From: Anders Torger To: Petri Helenius Date: Thu, 11 Mar 2004 16:16:15 +0100 User-Agent: KMail/1.6.1 References: <200403111459.11287.torger@ludd.luth.se> <40507287.1040203@he.iki.fi> In-Reply-To: <40507287.1040203@he.iki.fi> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200403111616.15668.torger@ludd.luth.se> cc: freebsd-threads@freebsd.org Subject: Re: Does PTHREAD_MUTEX_INITIALIZER work? X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Mar 2004 15:16:19 -0000 On Thursday 11 March 2004 15.07, you wrote: > Anders Torger wrote: > >Do the PTHREAD_MUTEX_INITIALIZER and PTHREAD_COND_INITIALIZER macros > >really work? > > > >What puzzles me is that pthread.h says: > > > >#define PTHREAD_MUTEX_INITIALIZER NULL > >#define PTHREAD_COND_INITIALIZER NULL > > > >that is the initialisers are NULL. > > > >I get some strange random temporary lockups and deaths in my program > >when running it on FreeBSD (5.0), while it works flawlessy on Linux, > >and one reason could perhaps be that the initialisers do not work on > >FreeBSD. > > 5.0 is an early new technology release, I would suggest using 5.2.1 > when reporting issues. PTHREAD_MUTEX_INITIALIZER is defined as NULL in 5.2.1 too. I shall test the software on that platform later though. However, it would be nice if someone could explain this NULL thing (it is not NULL on other pthread implementations I have looked at). Perhaps there is a perfectly natural explanation? /Anders Torger