Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Feb 2004 16:50:52 +0100
From:      des@des.no (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?=)
To:        Craig Rodrigues <rodrigc@crodrigues.org>
Cc:        threads@freebsd.org
Subject:   Re: checking lock ownership
Message-ID:  <xzp65ebhtb7.fsf@dwp.des.no>
In-Reply-To: <20040213150727.GA79077@crodrigues.org> (Craig Rodrigues's message of "Fri, 13 Feb 2004 10:07:27 -0500")
References:  <xzp1xozp5h5.fsf@dwp.des.no> <20040213150727.GA79077@crodrigues.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Craig Rodrigues <rodrigc@crodrigues.org> writes:
> On Fri, Feb 13, 2004 at 12:46:14PM +0100, Dag-Erling Sm?rgrav wrote:
> > Is there any way, either in POSIX or in FreeBSD, to check if a given
> > pthread_mutex_t is owned by the current thread?
> One way is to try unlock it with pthread_mutex_unlock().
> If that fails, and errno =3D=3D EPERM, then the current thread
> doesn't own the mutex.

I can't believe you even consider that as an option...

DES
--=20
Dag-Erling Sm=F8rgrav - des@des.no



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?xzp65ebhtb7.fsf>