From owner-freebsd-threads@FreeBSD.ORG Wed Jul 9 17:17:47 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 E3E4F37B401 for ; Wed, 9 Jul 2003 17:17:47 -0700 (PDT) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 685C943FBD for ; Wed, 9 Jul 2003 17:17:47 -0700 (PDT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (IDENT:brdavis@localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.12.9/8.12.3) with ESMTP id h6A0Hiib011877 for ; Wed, 9 Jul 2003 17:17:44 -0700 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.12.9/8.12.3/Submit) id h6A0Hi6d011876 for freebsd-threads@freebsd.org; Wed, 9 Jul 2003 17:17:44 -0700 Date: Wed, 9 Jul 2003 17:17:44 -0700 From: Brooks Davis To: freebsd-threads@freebsd.org Message-ID: <20030710001744.GA7135@Odin.AC.HMC.Edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="PNTmBPCT7hxwcZjr" Content-Disposition: inline User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-milter (http://amavis.org/) on odin.ac.hmc.edu Subject: 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 00:17:48 -0000 --PNTmBPCT7hxwcZjr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable I've got some Linux pthread code that goes something like this that I'm porting to FreeBSD: ------ pthread_t tid; tid =3D -1; /* Do stuff including maybe creating a thread. */ if (tid !=3D -1) { pthread_cancel(tid); pthread_join(tid, NULL); } ------ 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. -- Brooks --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 --PNTmBPCT7hxwcZjr Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/DLCnXY6L6fI4GtQRAjHNAKDUn1xykRWJxSo67Is/tvLhZAF09wCePdb+ adY9Ah11B/6HDE1Oe9g1evA= =gWeh -----END PGP SIGNATURE----- --PNTmBPCT7hxwcZjr--