Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 29 Nov 1998 14:49:17 +0100
From:      Eivind Eklund <eivind@yes.no>
To:        Daniel Eischen <eischen@vigrid.com>
Cc:        hackers@FreeBSD.ORG, lists@tar.com, jb@FreeBSD.ORG
Subject:   Thread locking (was Re: cvs commit: src/include pthread.h src/lib/libc_r/uthread uthread_mattr_kind_np.c uthread_mutex.c)
Message-ID:  <19981129144917.T9226@follo.net>
In-Reply-To: <199811290231.VAA28198@pcnet1.pcnet.com>; from Daniel Eischen on Sat, Nov 28, 1998 at 09:31:16PM -0500
References:  <199811290231.VAA28198@pcnet1.pcnet.com>

next in thread | previous in thread | raw e-mail | index | archive | help
[Moved from cvs-all to -hackers]

On Sat, Nov 28, 1998 at 09:31:16PM -0500, Daniel Eischen wrote:
> And can we also make a default mutex an error checking mutex?

Not easily.  The problem is that the default type of locks we've used
before are more forgiving - they e.g. allow a thread to lock a lock
several times (without deadlocking), and then release it by the first
pthread_unlock().

> Both POSIX and Single UNIX Spec 2 allow this.  SS2 allows that
> you can map PTHREAD_MUTEX_DEFAULT to any one of the other
> mutex types - it should be mapped to PTHREAD_MUTEX_ERRORCHECK.

Ideally it probably should.

> If at all possible, we should let the programmer know that he's
> hit a deadlock condition.

He won't hit a deadlock on the default type now.  The default type
doesn't really correspond to any of the SS2 types - I had to manually
add a deadlock to support PTHREAD_MUTEX_NORMAL.

Eivind.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



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