aboutsummaryrefslogtreecommitdiff
path: root/lib/libpthread/thread/thr_private.h
diff options
context:
space:
mode:
authorJohn Birrell <jb@FreeBSD.org>1998-09-30 06:22:07 +0000
committerJohn Birrell <jb@FreeBSD.org>1998-09-30 06:22:07 +0000
commita247f8331640a1b2c5831bcaf14cfc55cda08b99 (patch)
tree5197f0f3772def2a0f50d49b8ccf71494abef890 /lib/libpthread/thread/thr_private.h
parenta0aa3890076fc8f114c2b73256a7de3f884649ee (diff)
downloadsrc-a247f8331640a1b2c5831bcaf14cfc55cda08b99.tar.gz
src-a247f8331640a1b2c5831bcaf14cfc55cda08b99.zip
- Fix the debug macros.
- Add support of a thread being listed in the dead thread list as well as the thread list. - Add a new thread state to make sigwait work properly. (Submitted by Daniel M. Eischen <eischen@vigrid.com>) - Add global variable for the garbage collector mutex and condition variable. - Delete a couple of prototypes that are no longer required. - Add a prototype for the garbage collector thread.
Notes
Notes: svn path=/head/; revision=39803
Diffstat (limited to 'lib/libpthread/thread/thr_private.h')
-rw-r--r--lib/libpthread/thread/thr_private.h25
1 files changed, 21 insertions, 4 deletions
diff --git a/lib/libpthread/thread/thr_private.h b/lib/libpthread/thread/thr_private.h
index 5b76a860b9ff..04600cfbb3be 100644
--- a/lib/libpthread/thread/thr_private.h
+++ b/lib/libpthread/thread/thr_private.h
@@ -62,8 +62,8 @@
#define PANIC(string) _thread_exit(__FILE__,__LINE__,string)
/* Output debug messages like this: */
-#define stdout_debug(_x) _write(1,_x,strlen(_x));
-#define stderr_debug(_x) _write(2,_x,strlen(_x));
+#define stdout_debug(_x) _thread_sys_write(1,_x,strlen(_x));
+#define stderr_debug(_x) _thread_sys_write(2,_x,strlen(_x));
/*
* State change macro:
@@ -252,6 +252,7 @@ enum pthread_state {
PS_SELECT_WAIT,
PS_SLEEP_WAIT,
PS_WAIT_WAIT,
+ PS_SIGSUSPEND,
PS_SIGWAIT,
PS_JOIN,
PS_SUSPENDED,
@@ -333,6 +334,11 @@ struct pthread {
struct pthread *nxt;
/*
+ * Pointer to the next thread in the dead thread linked list.
+ */
+ struct pthread *nxt_dead;
+
+ /*
* Thread start routine, argument, stack pointer and thread
* attributes.
*/
@@ -591,6 +597,18 @@ SCLASS int _thread_dtablesize /* Descriptor table size. */
;
#endif
+/* Garbage collector mutex and condition variable. */
+SCLASS pthread_mutex_t _gc_mutex
+#ifdef GLOBAL_PTHREAD_PRIVATE
+= NULL
+#endif
+;
+SCLASS pthread_cond_t _gc_cond
+#ifdef GLOBAL_PTHREAD_PRIVATE
+= NULL
+#endif
+;
+
/*
* Array of signal actions for this process.
*/
@@ -623,10 +641,8 @@ int _thread_fd_lock(int, int, struct timespec *);
int _thread_fd_lock_debug(int, int, struct timespec *,char *fname,int lineno);
void _dispatch_signals(void);
void _thread_signal(pthread_t, int);
-void _lock_dead_thread_list(void);
void _lock_thread(void);
void _lock_thread_list(void);
-void _unlock_dead_thread_list(void);
void _unlock_thread(void);
void _unlock_thread_list(void);
void _thread_exit(char *, int, char *);
@@ -649,6 +665,7 @@ int _thread_queue_remove(struct pthread_queue *, struct pthread *);
int _thread_fd_table_init(int fd);
struct pthread *_thread_queue_get(struct pthread_queue *);
struct pthread *_thread_queue_deq(struct pthread_queue *);
+pthread_addr_t _thread_gc(pthread_addr_t);
/* #include <signal.h> */
int _thread_sys_sigaction(int, const struct sigaction *, struct sigaction *);