From owner-freebsd-threads@FreeBSD.ORG Sat Mar 13 16:59:09 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2C95616A4CE; Sat, 13 Mar 2004 16:59:09 -0800 (PST) Received: from smtp01.syd.iprimus.net.au (smtp01.syd.iprimus.net.au [210.50.30.52]) by mx1.FreeBSD.org (Postfix) with ESMTP id 43F2943D1F; Sat, 13 Mar 2004 16:59:08 -0800 (PST) (envelope-from tim@robbins.dropbear.id.au) Received: from robbins.dropbear.id.au (210.50.204.88) by smtp01.syd.iprimus.net.au (7.0.024) id 402BA92700A06F26; Sun, 14 Mar 2004 11:59:06 +1100 Received: by robbins.dropbear.id.au (Postfix, from userid 1000) id 4C8E541BA; Sun, 14 Mar 2004 11:59:25 +1100 (EST) Date: Sun, 14 Mar 2004 11:59:25 +1100 From: Tim Robbins To: Peter Wemm Message-ID: <20040314005925.GA21214@cat.robbins.dropbear.id.au> References: <200403131622.43705.peter@wemm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200403131622.43705.peter@wemm.org> User-Agent: Mutt/1.4.1i cc: threads@freebsd.org cc: freebsd-threads@freebsd.org Subject: Re: RFC: getc() and putc() as macros X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Mar 2004 00:59:09 -0000 On Sat, Mar 13, 2004 at 04:22:43PM -0800, Peter Wemm wrote: > On Saturday 13 March 2004 07:05 am, Daniel Eischen wrote: > > On Sat, 13 Mar 2004, Tim Robbins wrote: > > > The patch below re-adds macro versions of getc(), getchar(), > > > putc(), putchar(), feof(), ferror(), fileno() and clearerr(), using > > > the value of __isthreaded to decide between the fast inline > > > single-threaded code and the more general function equivalent (as > > > suggested by Alfred). Is this approach safe? > > > > I don't really like this. It exposes __isthreaded and others > > that are implementation. > > I thought that was the kind of thing that _REENTRANT or _THREAD_SAFE > are usually for? (*shudder*) Not anymore - we have to check at runtime. Tim