Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 May 2004 23:38:51 -0400 (EDT)
From:      Daniel Eischen <eischen@vigrid.com>
To:        =?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?= <des@des.no>
Cc:        freebsd-threads@freebsd.org
Subject:   Re: libthr, libpthread problems
Message-ID:  <Pine.GSO.4.10.10405022336340.1760-100000@pcnet5.pcnet.com>
In-Reply-To: <xzp4qqyo08k.fsf@dwp.des.no>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 3 May 2004, [iso-8859-1] Dag-Erling Sm=F8rgrav wrote:

> Archie Cobbs <archie@dellroad.org> writes:
> > Dan Eischen wrote:
> > > Sounds like a bug in the application (recurse count shouldn't
> > > be less than zero).
> > Nope.. here's a simpler test case that demonstrates the problem:
>=20
> Perfectly reproducable, definitely a libthr bug:

Yes, I replied yesterday with a patch to libthr to fix the problem,
but the @threads address was screwed up in the message header so it
never made the list.  Here it is again.

Index: thread/thr_mutex.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /opt/FreeBSD/cvs/src/lib/libthr/thread/thr_mutex.c,v
retrieving revision 1.25
diff -u -r1.25 thr_mutex.c
--- thread/thr_mutex.c=0929 Mar 2004 09:35:07 -0000=091.25
+++ thread/thr_mutex.c=091 May 2004 22:18:34 -0000
@@ -414,6 +414,8 @@
 =09=09/* Nothing */
 =09=09break;
 =09}
+=09if ((*mutex)->m_type =3D=3D PTHREAD_MUTEX_RECURSIVE)
+=09=09(*mutex)->m_data.m_count++;
 =09_thread_critical_exit(curthread);
 out:
 =09_SPINUNLOCK(&(*mutex)->lock);

--=20
Dan Eischen



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.10.10405022336340.1760-100000>