diff options
author | Russ Cox <rsc@swtch.com> | 2020-12-30 07:18:30 -0500 |
---|---|---|
committer | Russ Cox <rsc@swtch.com> | 2020-12-30 07:53:28 -0500 |
commit | 18571208068d5fe2f0bf7b4e980525a7f577c503 (patch) | |
tree | baf2061164df38258cc6127a102ab76d9089fb31 /include | |
parent | e68f07d46f5f168dc2076286627279540bf1f99e (diff) | |
download | plan9port-18571208068d5fe2f0bf7b4e980525a7f577c503.tar.gz plan9port-18571208068d5fe2f0bf7b4e980525a7f577c503.tar.bz2 plan9port-18571208068d5fe2f0bf7b4e980525a7f577c503.zip |
libthread: simplify
Now that everything uses pthreads and pthreadperthread,
can delete various conditionals, all the custom context code,
and so on. Also update documents.
Fixes #355.
Diffstat (limited to 'include')
-rw-r--r-- | include/libc.h | 2 | ||||
-rw-r--r-- | include/u.h | 7 |
2 files changed, 1 insertions, 8 deletions
diff --git a/include/libc.h b/include/libc.h index 4bb537d6..1e24f0bb 100644 --- a/include/libc.h +++ b/include/libc.h @@ -473,10 +473,8 @@ extern _Thread *(*threadnow)(void); typedef struct Lock Lock; struct Lock { -#ifdef PLAN9PORT_USING_PTHREADS int init; pthread_mutex_t mutex; -#endif int held; }; diff --git a/include/u.h b/include/u.h index f84e348a..856e10f4 100644 --- a/include/u.h +++ b/include/u.h @@ -67,7 +67,6 @@ typedef long p9jmp_buf[sizeof(sigjmp_buf)/sizeof(long)]; #if defined(__linux__) # include <sys/types.h> # include <pthread.h> -# define PLAN9PORT_USING_PTHREADS 1 # if defined(__USE_MISC) # undef _NEEDUSHORT # undef _NEEDUINT @@ -76,7 +75,6 @@ typedef long p9jmp_buf[sizeof(sigjmp_buf)/sizeof(long)]; #elif defined(__sun__) # include <sys/types.h> # include <pthread.h> -# define PLAN9PORT_USING_PTHREADS 1 # undef _NEEDUSHORT # undef _NEEDUINT # undef _NEEDULONG @@ -84,7 +82,6 @@ typedef long p9jmp_buf[sizeof(sigjmp_buf)/sizeof(long)]; #elif defined(__FreeBSD__) # include <sys/types.h> # include <osreldate.h> -# define PLAN9PORT_USING_PTHREADS 1 # include <pthread.h> # if !defined(_POSIX_SOURCE) # undef _NEEDUSHORT @@ -93,7 +90,6 @@ typedef long p9jmp_buf[sizeof(sigjmp_buf)/sizeof(long)]; #elif defined(__APPLE__) # include <sys/types.h> # include <pthread.h> -# define PLAN9PORT_USING_PTHREADS 1 # if __GNUC__ < 4 # undef _NEEDUSHORT # undef _NEEDUINT @@ -108,20 +104,19 @@ typedef long p9jmp_buf[sizeof(sigjmp_buf)/sizeof(long)]; #elif defined(__NetBSD__) # include <sched.h> # include <sys/types.h> +# include <pthread.h> # undef _NEEDUSHORT # undef _NEEDUINT # undef _NEEDULONG #elif defined(__OpenBSD__) # include <sys/types.h> # include <pthread.h> -# define PLAN9PORT_USING_PTHREADS 1 # undef _NEEDUSHORT # undef _NEEDUINT # undef _NEEDULONG #else /* No idea what system this is -- try some defaults */ # include <pthread.h> -# define PLAN9PORT_USING_PTHREADS 1 #endif #ifndef O_DIRECT |