From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 27 07:18:53 2007 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 81D2F16A400 for ; Fri, 27 Apr 2007 07:18:53 +0000 (UTC) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (gate.funkthat.com [69.17.45.168]) by mx1.freebsd.org (Postfix) with ESMTP id 4DB4113C4BB for ; Fri, 27 Apr 2007 07:18:53 +0000 (UTC) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (jmn14xyw7hcndmxd@localhost.funkthat.com [127.0.0.1]) by hydrogen.funkthat.com (8.13.6/8.13.3) with ESMTP id l3R75Lh7060137; Fri, 27 Apr 2007 00:05:21 -0700 (PDT) (envelope-from jmg@hydrogen.funkthat.com) Received: (from jmg@localhost) by hydrogen.funkthat.com (8.13.6/8.13.3/Submit) id l3R75LWn060136; Fri, 27 Apr 2007 00:05:21 -0700 (PDT) (envelope-from jmg) Date: Fri, 27 Apr 2007 00:05:21 -0700 From: John-Mark Gurney To: Hans Petter Selasky Message-ID: <20070427070521.GH73385@funkthat.com> Mail-Followup-To: Hans Petter Selasky , Bosko Milekic , freebsd-hackers@freebsd.org References: <200704262136.33196.hselasky@c2i.net> <200704270750.04606.hselasky@c2i.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200704270750.04606.hselasky@c2i.net> User-Agent: Mutt/1.4.2.1i X-Operating-System: FreeBSD 5.4-RELEASE-p6 i386 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html Cc: freebsd-hackers@freebsd.org, Bosko Milekic Subject: Re: msleep() on recursivly locked mutexes X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: John-Mark Gurney List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2007 07:18:53 -0000 Hans Petter Selasky wrote this message on Fri, Apr 27, 2007 at 07:50 +0200: > On Thursday 26 April 2007 23:52, Bosko Milekic wrote: > > On 4/26/07, Hans Petter Selasky wrote: > > > Hi, > > > > > > In the new USB stack I have defined the following: > > > > Could you perhaps describe some of the codepaths in the USB stack that > > require this behavior? > > There are no requirements for that. It is just for the convenience of unwary > USB device driver developers. The reason we have restrictions on such things as prevention of recursion on mutexes is for the convenience of the unwary developer so they don't do something stupid, and not realize it till it's causing bugs... Multithreaded programming is hard, and even w/ the power of witness, is still hard to get right, and we need to help capable programmers not make mistakes... There is always ugen if the driver developer doesn't want to deal w/ making their driver multithread safe... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."