checking lock ownership

Dag-ErlingSmørgrav des at des.no
Fri Feb 13 07:51:00 PST 2004


Craig Rodrigues <rodrigc at 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 == EPERM, then the current thread
> doesn't own the mutex.

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

DES
-- 
Dag-Erling Smørgrav - des at des.no


More information about the freebsd-threads mailing list