null pthread_t

Brooks Davis brooks at one-eyed-alien.net
Wed Jul 9 17:17:48 PDT 2003


I've got some Linux pthread code that goes something like this that I'm
porting to FreeBSD:

------
pthread_t tid;

tid = -1;

/* Do stuff including maybe creating a thread. */

if (tid != -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

-- 
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-threads/attachments/20030709/bd96f658/attachment.bin


More information about the freebsd-threads mailing list