From owner-freebsd-threads@FreeBSD.ORG Thu Jul 10 03:25:56 2003 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 990D737B401 for ; Thu, 10 Jul 2003 03:25:56 -0700 (PDT) Received: from puffin.mail.pas.earthlink.net (puffin.mail.pas.earthlink.net [207.217.120.139]) by mx1.FreeBSD.org (Postfix) with ESMTP id 27B9A43FB1 for ; Thu, 10 Jul 2003 03:25:56 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from user-2ivfjrs.dialup.mindspring.com ([165.247.207.124] helo=mindspring.com) by puffin.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 19aYcd-0003zM-00; Thu, 10 Jul 2003 03:25:55 -0700 Message-ID: <3F0D3EF6.A9000297@mindspring.com> Date: Thu, 10 Jul 2003 03:24:54 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Brooks Davis References: <20030710001744.GA7135@Odin.AC.HMC.Edu> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a43df10a0ee0c97f68bd1f5a0c04e73e3ba2d4e88014a4647c350badd9bab72f9c350badd9bab72f9c cc: freebsd-threads@freebsd.org Subject: Re: null pthread_t 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: Thu, 10 Jul 2003 10:25:56 -0000 Brooks Davis wrote: > Since FreeBSD uses pointers instead of integers for pthread_t's, this > generates warnings which go away if you replace -1 with NULL, but > it seems like that is likely to do bad things on linux. Is there a > portable NULL-equivalent pthread_t? I'm not seeing anything jump out at > me in the headers. pthread_t PTHREAD_NULL; /* global NULL equivalent */ pthread_t ptr; ... if( ptr == PTHREAD_NULL) Basically, the type will be a BSS zero'ed global "NULL" in both compilation environments, and the comparison will "just work" because the type will be right. -- Terry