Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Feb 2008 11:31:09 -0500 (EST)
From:      Daniel Eischen <deischen@freebsd.org>
To:        =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@des.no>
Cc:        cvs-src@freebsd.org, src-committers@freebsd.org, cvs-all@freebsd.org, threads@freebsd.org
Subject:   Re: cvs commit: src/include pthread_np.h src/lib/libthr pthread.map src/lib/libthr/thread thr_mutex.c
Message-ID:  <Pine.GSO.4.64.0802041123210.13899@sea.ntplx.net>
In-Reply-To: <868x20elw0.fsf@ds4.des.no>
References:  <200802032238.m13McAbf065324@repoman.freebsd.org> <86d4rdgehd.fsf@ds4.des.no> <Pine.GSO.4.64.0802041042370.13743@sea.ntplx.net> <868x20elw0.fsf@ds4.des.no>

next in thread | previous in thread | raw e-mail | index | archive | help
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

---559023410-684387517-1202142669=:13899
Content-Type: TEXT/PLAIN; charset=utf-8; format=flowed
Content-Transfer-Encoding: QUOTED-PRINTABLE

On Mon, 4 Feb 2008, Dag-Erling Sm=C3=B8rgrav wrote:

> Daniel Eischen <deischen@freebsd.org> writes:
>> I thought you wanted to know if it was locked regardless of who locked
>> it.
>
> Uh, no, that was not the intention.
>
>> If you want to know if the current thread has it locked, it should be
>> called pthread_mutex_isowned_np().
>
> I don't see why one would be more correct than the other...

Because it is more obvious that _isowned() is for the current thread
than _islocked().  As you can tell by my previous (incorrect)=20
assumption.

There is prior art for this outside of FreeBSD.  Solaris has
mutex_owned() as part of their kernel mutex API.  I would
suggest using pthread_mutex_owned_np().  Hmm, even FreeBSD has
mtx_owned() :-)

--=20
DE
---559023410-684387517-1202142669=:13899--



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