Date: Thu, 23 Sep 2010 18:44:55 -0400 (EDT) From: Daniel Eischen <deischen@freebsd.org> To: Jung-uk Kim <jkim@freebsd.org> Cc: freebsd-threads@freebsd.org Subject: Re: threads/150889: PTHREAD_MUTEX_INITIALIZER + pthread_mutex_destroy() == EINVAL Message-ID: <Pine.GSO.4.64.1009231839080.18138@sea.ntplx.net> In-Reply-To: <201009232220.o8NMK3fX011639@freefall.freebsd.org> References: <201009232220.o8NMK3fX011639@freefall.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 23 Sep 2010, Jung-uk Kim wrote: > The following reply was made to PR threads/150889; it has been noted by GNATS. > > From: Jung-uk Kim <jkim@FreeBSD.org> > To: bug-followup@FreeBSD.org, > cgf@netapp.com > Cc: > Subject: Re: threads/150889: PTHREAD_MUTEX_INITIALIZER + pthread_mutex_destroy() == EINVAL > Date: Thu, 23 Sep 2010 18:12:02 -0400 > > I was horribly bitten by the incompatibility when I ported IcedTea6 > Java plugin for Linux. Please see my comments in the patch: > > http://www.freebsd.org/cgi/cvsweb.cgi/ports/java/openjdk6/files/icedtea.patch?rev=1.2;content-type=text%2Fplain You shouldn't have to call pthread_mutex_init() on a mutex initialized with PTHREAD_MUTEX_INITIALIZER. Our implementation should auto initialize the mutex when it is first used; if it doesn't, I think that is a bug. You _do have_ to lock the mutex before calling a condition wait, however. This is a POSIX requirement. -- DE
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.64.1009231839080.18138>