From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7663 invoked by alias); 9 Jul 2005 14:30:25 -0000 Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Received: (qmail 7641 invoked by uid 22791); 9 Jul 2005 14:30:16 -0000 Received: from smtpauth05.mail.atl.earthlink.net (HELO smtpauth05.mail.atl.earthlink.net) (209.86.89.65) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Sat, 09 Jul 2005 14:30:16 +0000 Received: from [69.143.212.61] (helo=PAULD) by smtpauth05.mail.atl.earthlink.net with asmtp (Exim 4.34) id 1DrGLO-0005vu-TY for ecos-discuss@ecos.sourceware.org; Sat, 09 Jul 2005 10:30:14 -0400 From: "Paul D. DeRocco" To: "eCos Discuss" Date: Sat, 09 Jul 2005 14:30:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit In-Reply-To: <20050708140827.GA2640@lunn.ch> X-ELNK-Trace: bd7d5d4e6f8f652c74cfc7ce3b1ad11381c87f5e51960688b43be85d4c973d384fd965b0e11edc38350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c Subject: RE: [ECOS] Mutex & Asserts during initialisation X-SW-Source: 2005-07/txt/msg00088.txt.bz2 > From: Andrew Lunn > > Humm, i think this is reasonable behaviour. Anything that tries to use > a mutex must assume it can block. Otherwise why are you using a mutex! I can see the other side of this. You want to write a driver that can work in a multi-threaded environment, so you include a mutex in it. But then you want to call it from startup code. Rather than write a second specialized non-multi-threaded driver, or include some sort of flag that tells it to skip the locking and unlocking, it's much cleaner to simply consider the attempt to lock a mutex before the threading system has been initialized a harmless null operation. -- Ciao, Paul D. DeRocco Paul mailto:pderocco@ix.netcom.com -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss