summaryrefslogtreecommitdiffstats
path: root/lib/libc/include/libc_private.h
diff options
context:
space:
mode:
authordeischen <deischen@FreeBSD.org>2002-11-13 18:12:09 +0000
committerdeischen <deischen@FreeBSD.org>2002-11-13 18:12:09 +0000
commitbf8788517dc3dbb62a46b61b9a2e31a4ba2d3dd4 (patch)
tree17bf495d45d13c8027b110379dd80aa876f77940 /lib/libc/include/libc_private.h
parentf737ca00a463d77a4a5c24d8108a16f68b2a2f66 (diff)
downloadFreeBSD-src-bf8788517dc3dbb62a46b61b9a2e31a4ba2d3dd4.zip
FreeBSD-src-bf8788517dc3dbb62a46b61b9a2e31a4ba2d3dd4.tar.gz
Use a jump table (a la Solaris) for pthread routines with default
entries in the table being stubs. While I'm here, add macros to auto-generate the stubs. A conforming threads library can override the stub routines by filling in the jump table. Add some entries to namespace.h and sync un-namespace.h to it. Also add a comment to remind folks to update un-namespace.h when changing namespace.h.
Diffstat (limited to 'lib/libc/include/libc_private.h')
-rw-r--r--lib/libc/include/libc_private.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/lib/libc/include/libc_private.h b/lib/libc/include/libc_private.h
index e47e756..96ee8ad 100644
--- a/lib/libc/include/libc_private.h
+++ b/lib/libc/include/libc_private.h
@@ -64,6 +64,48 @@ extern int __isthreaded;
#define FUNLOCKFILE(fp) if (__isthreaded) _funlockfile(fp)
/*
+ * Indexes into the pthread jump table.
+ *
+ * Warning! If you change this type, you must also change the threads
+ * libraries that reference it (libc_r, libpthread).
+ */
+typedef enum {
+ PJT_COND_BROADCAST,
+ PJT_COND_DESTROY,
+ PJT_COND_INIT,
+ PJT_COND_SIGNAL,
+ PJT_COND_WAIT,
+ PJT_GETSPECIFIC,
+ PJT_KEY_CREATE,
+ PJT_KEY_DELETE,
+ PJT_MAIN_NP,
+ PJT_MUTEX_DESTROY,
+ PJT_MUTEX_INIT,
+ PJT_MUTEX_LOCK,
+ PJT_MUTEX_TRYLOCK,
+ PJT_MUTEX_UNLOCK,
+ PJT_MUTEXATTR_DESTROY,
+ PJT_MUTEXATTR_INIT,
+ PJT_MUTEXATTR_SETTYPE,
+ PJT_ONCE,
+ PJT_RWLOCK_DESTROY,
+ PJT_RWLOCK_INIT,
+ PJT_RWLOCK_RDLOCK,
+ PJT_RWLOCK_TRYRDLOCK,
+ PJT_RWLOCK_TRYWRLOCK,
+ PJT_RWLOCK_UNLOCK,
+ PJT_RWLOCK_WRLOCK,
+ PJT_SELF,
+ PJT_SETSPECIFIC,
+ PJT_SIGMASK,
+ PJT_MAX
+} pjt_index_t;
+
+typedef int (*pthread_func_t)();
+
+extern pthread_func_t __thr_jtable[][];
+
+/*
* This is a pointer in the C run-time startup code. It is used
* by getprogname() and setprogname().
*/
OpenPOWER on IntegriCloud