diff options
author | jb <jb@FreeBSD.org> | 1998-04-03 09:31:15 +0000 |
---|---|---|
committer | jb <jb@FreeBSD.org> | 1998-04-03 09:31:15 +0000 |
commit | 6a1d5a165901cbf6b76376a6c35d2306b55a2f72 (patch) | |
tree | 1c3148ba26408447be3c48a1afe9b17da5335d40 /lib/libpthread/thread/thr_private.h | |
parent | a6ff3fe2e91fc381861cc7c8409c5d66ba9cdf6c (diff) | |
download | FreeBSD-src-6a1d5a165901cbf6b76376a6c35d2306b55a2f72.zip FreeBSD-src-6a1d5a165901cbf6b76376a6c35d2306b55a2f72.tar.gz |
Add a magic field to the pthread structure to help recognize valid
threads from invalid ones. The pthread structure is opaque to the user
so this change does not cause any incompatibilities.
Hopefully this change will help code that was written for draft 4
fail gracefully if the programmer ignores the compiler warning about
the change in the level of indirection for the argument passed to
pthread_detach(). I got burnt, so I fixed then (expletive deleted)
thing.
These functions comply with the revised standard. That should shut
Terry up!
Diffstat (limited to 'lib/libpthread/thread/thr_private.h')
-rw-r--r-- | lib/libpthread/thread/thr_private.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/libpthread/thread/thr_private.h b/lib/libpthread/thread/thr_private.h index 7d5bf89..e4b377a 100644 --- a/lib/libpthread/thread/thr_private.h +++ b/lib/libpthread/thread/thr_private.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995 John Birrell <jb@cimlogic.com.au>. + * Copyright (c) 1995-1998 John Birrell <jb@cimlogic.com.au>. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -278,6 +278,13 @@ union pthread_wait_data { */ struct pthread { /* + * Magic value to help recognize a valid thread structure + * from an invalid one: + */ +#define PTHREAD_MAGIC ((u_int32_t) 0xd09ba115) + u_int32_t magic; + + /* * Pointer to the next thread in the thread linked list. */ struct pthread *nxt; |