Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 04 Feb 2008 12:14:54 +0100
From:      =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@des.no>
To:        src-committers@FreeBSD.org
Cc:        cvs-src@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:  <86d4rdgehd.fsf@ds4.des.no>
In-Reply-To: <200802032238.m13McAbf065324@repoman.freebsd.org> (Dag-Erling Smorgrav's message of "Sun\, 3 Feb 2008 22\:38\:10 %2B0000 \(UTC\)")
References:  <200802032238.m13McAbf065324@repoman.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Dag-Erling Smorgrav <des@FreeBSD.org> writes:
>   Log:
>   Add pthread_mutex_islocked_np(), a cheap way to verify that a mutex is
>   locked.  This is intended primarily to support the userland equivalent
>   of the various *_ASSERT_LOCKED() macros we have in the kernel.

I'm having second thoughts about this one.  There is a significant risk
of false positives if the mutex is currently locked by another thread.
I'm wondering whether to a) change the implementation so it only returns
true if the mutex is owned by the current thread, or b) change the
interface so you can specify a specific thread, or NULL for "any".

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no



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