From owner-freebsd-hackers Sun Nov 29 05:49:38 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id FAA00957 for freebsd-hackers-outgoing; Sun, 29 Nov 1998 05:49:38 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from ns1.yes.no (ns1.yes.no [195.204.136.10]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id FAA00951; Sun, 29 Nov 1998 05:49:29 -0800 (PST) (envelope-from eivind@bitbox.follo.net) Received: from bitbox.follo.net (bitbox.follo.net [195.204.143.218]) by ns1.yes.no (8.9.1a/8.9.1) with ESMTP id OAA06436; Sun, 29 Nov 1998 14:49:19 +0100 (CET) Received: (from eivind@localhost) by bitbox.follo.net (8.8.8/8.8.6) id OAA08268; Sun, 29 Nov 1998 14:49:18 +0100 (MET) Message-ID: <19981129144917.T9226@follo.net> Date: Sun, 29 Nov 1998 14:49:17 +0100 From: Eivind Eklund To: Daniel Eischen 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) References: <199811290231.VAA28198@pcnet1.pcnet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.93.2i In-Reply-To: <199811290231.VAA28198@pcnet1.pcnet.com>; from Daniel Eischen on Sat, Nov 28, 1998 at 09:31:16PM -0500 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG [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