From owner-freebsd-stable Sat Aug 12 13:45:14 2000 Delivered-To: freebsd-stable@freebsd.org Received: from pcnet1.pcnet.com (pcnet1.pcnet.com [204.213.232.3]) by hub.freebsd.org (Postfix) with ESMTP id 3F67237B58E; Sat, 12 Aug 2000 13:45:11 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: (from eischen@localhost) by pcnet1.pcnet.com (8.8.7/PCNet) id QAA13764; Sat, 12 Aug 2000 16:44:50 -0400 (EDT) Date: Sat, 12 Aug 2000 16:44:49 -0400 (EDT) From: Daniel Eischen To: Alfred Perlstein Cc: "Bradley T. Hughes" , stable@FreeBSD.ORG, jasone@FreeBSD.ORG Subject: Re: (recursive lock problem) Re: bug in pthread implementation In-Reply-To: <20000812103306.G4854@fw.wintelcom.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sat, 12 Aug 2000, Alfred Perlstein wrote: > * Bradley T. Hughes [000812 09:16] wrote: > > It seems that the mutex implementation for recursive mutexes has a bug. > > > > a single lock/unlock pair works as expected, but locking 3 times only > > requires 2 unlocks before the mutex is released. i've read through > > src/lib/libc_r/uthread/uthread_mutex.c but can't quite follow the logic... > > > > i plan on debugging this more and hope to generate a patch... but i > > figured i'd send off an email about it to see if anyone else can find the > > solution quicker than i can :) > > It looks like an off-by-one-error in libc_r, let me know if this works: [ Patch elided ] > Attached so Jason and Daniel can have a look: This looks good to me :-). Consider it reviewed and commit it if you'd like. -- Dan Eischen To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message