summaryrefslogtreecommitdiffstats
path: root/sys/sys/thr.h
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2004-07-02 00:40:07 +0000
committermarcel <marcel@FreeBSD.org>2004-07-02 00:40:07 +0000
commit622fe058c99b4a6cac2805c8352c92b4330882f9 (patch)
tree9c8400ddc4d640b6eb03f81ba5983718f183b0e0 /sys/sys/thr.h
parente84fdd61ba2c15de745151bb597597aed2b690ed (diff)
downloadFreeBSD-src-622fe058c99b4a6cac2805c8352c92b4330882f9.zip
FreeBSD-src-622fe058c99b4a6cac2805c8352c92b4330882f9.tar.gz
Change the thread ID (thr_id_t) used for 1:1 threading from being a
pointer to the corresponding struct thread to the thread ID (lwpid_t) assigned to that thread. The primary reason for this change is that libthr now internally uses the same ID as the debugger and the kernel when referencing to a kernel thread. This allows us to implement the support for debugging without additional translations and/or mappings. To preserve the ABI, the 1:1 threading syscalls, including the umtx locking API have not been changed to work on a lwpid_t. Instead the 1:1 threading syscalls operate on long and the umtx locking API has not been changed except for the contested bit. Previously this was the least significant bit. Now it's the most significant bit. Since the contested bit should not be tested by userland, this change is not expected to be visible. Just to be sure, UMTX_CONTESTED has been removed from <sys/umtx.h>. Reviewed by: mtm@ ABI preservation tested on: i386, ia64
Diffstat (limited to 'sys/sys/thr.h')
-rw-r--r--sys/sys/thr.h13
1 files changed, 4 insertions, 9 deletions
diff --git a/sys/sys/thr.h b/sys/sys/thr.h
index cd0e732..ea36af3 100644
--- a/sys/sys/thr.h
+++ b/sys/sys/thr.h
@@ -30,11 +30,6 @@
#ifndef _SYS_THR_H_
#define _SYS_THR_H_
-/*
- * Globally unique thread id type.
- */
-typedef void * thr_id_t;
-
#define THR_SUSPENDED 0x0001 /* Create the thread in the suspended state. */
/*
@@ -42,12 +37,12 @@ typedef void * thr_id_t;
*/
#ifndef _KERNEL
-int thr_create(ucontext_t *ctx, thr_id_t *id, int flags);
-int thr_self(thr_id_t *id);
+int thr_create(ucontext_t *ctx, long *id, int flags);
+int thr_self(long *id);
void thr_exit(void);
-int thr_kill(thr_id_t id, int sig);
+int thr_kill(long id, int sig);
int thr_suspend(const struct timespec *timeout);
-int thr_wake(thr_id_t id);
+int thr_wake(long id);
#endif /* !_KERNEL */
OpenPOWER on IntegriCloud