summaryrefslogtreecommitdiffstats
path: root/lib/libc_r/uthread/pthread_private.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc_r/uthread/pthread_private.h')
-rw-r--r--lib/libc_r/uthread/pthread_private.h59
1 files changed, 40 insertions, 19 deletions
diff --git a/lib/libc_r/uthread/pthread_private.h b/lib/libc_r/uthread/pthread_private.h
index a16bdea..064888f 100644
--- a/lib/libc_r/uthread/pthread_private.h
+++ b/lib/libc_r/uthread/pthread_private.h
@@ -59,6 +59,15 @@
#define PANIC(string) _thread_exit(__FILE__,__LINE__,string)
/*
+ * State change macro:
+ */
+#define PTHREAD_NEW_STATE(thrd, newstate) { \
+ (thrd)->state = newstate; \
+ (thrd)->fname = __FILE__; \
+ (thrd)->lineno = __LINE__; \
+}
+
+/*
* Queue definitions.
*/
struct pthread_queue {
@@ -206,19 +215,6 @@ struct sched_param {
*/
#define TIMESLICE_USEC 100000
-/*
- * Flags.
- */
-#define PTHREAD_DETACHED 0x1
-#define PTHREAD_SCOPE_SYSTEM 0x2
-#define PTHREAD_INHERIT_SCHED 0x4
-#define PTHREAD_NOFLOAT 0x8
-
-#define PTHREAD_CREATE_DETACHED PTHREAD_DETACHED
-#define PTHREAD_CREATE_JOINABLE 0
-#define PTHREAD_SCOPE_PROCESS 0
-#define PTHREAD_EXPLICIT_SCHED 0
-
struct pthread_key {
pthread_mutex_t mutex;
long count;
@@ -407,6 +403,15 @@ struct pthread {
/* Wait data. */
union pthread_wait_data data;
+ /*
+ * Set to TRUE if a blocking operation was
+ * interrupted by a signal:
+ */
+ int interrupted;
+
+ /* Signal number when in state PS_SIGWAIT: */
+ int signo;
+
/* Miscellaneous data. */
char flags;
char pthread_priority;
@@ -416,6 +421,8 @@ struct pthread {
/* Cleanup handlers Link List */
struct pthread_cleanup *cleanup;
+ char *fname; /* Ptr to source file name */
+ int lineno; /* Source line number. */
};
/*
@@ -426,7 +433,7 @@ struct pthread {
SCLASS struct pthread _thread_kern_thread;
/* Ptr to the thread structure for the running thread: */
-SCLASS struct pthread *_thread_run
+SCLASS struct pthread * volatile _thread_run
#ifdef GLOBAL_PTHREAD_PRIVATE
= &_thread_kern_thread;
#else
@@ -437,7 +444,7 @@ SCLASS struct pthread *_thread_run
* Ptr to the thread running in single-threaded mode or NULL if
* running multi-threaded (default POSIX behaviour).
*/
-SCLASS struct pthread *_thread_single
+SCLASS struct pthread * volatile _thread_single
#ifdef GLOBAL_PTHREAD_PRIVATE
= NULL;
#else
@@ -445,7 +452,7 @@ SCLASS struct pthread *_thread_single
#endif
/* Ptr to the first thread in the thread linked list: */
-SCLASS struct pthread *_thread_link_list
+SCLASS struct pthread * volatile _thread_link_list
#ifdef GLOBAL_PTHREAD_PRIVATE
= NULL;
#else
@@ -481,7 +488,7 @@ SCLASS struct timeval kern_inc_prio_time
#endif
/* Dead threads: */
-SCLASS struct pthread *_thread_dead
+SCLASS struct pthread * volatile _thread_dead
#ifdef GLOBAL_PTHREAD_PRIVATE
= NULL;
#else
@@ -505,7 +512,7 @@ SCLASS struct pthread_attr pthread_attr_default
;
#endif
-/* Default thread attributes: */
+/* Default mutex attributes: */
SCLASS struct pthread_mutex_attr pthread_mutexattr_default
#ifdef GLOBAL_PTHREAD_PRIVATE
= { MUTEX_TYPE_FAST, 0 };
@@ -513,6 +520,21 @@ SCLASS struct pthread_mutex_attr pthread_mutexattr_default
;
#endif
+/* Default condition variable attributes: */
+SCLASS struct pthread_cond_attr pthread_condattr_default
+#ifdef GLOBAL_PTHREAD_PRIVATE
+= { COND_TYPE_FAST, 0 };
+#else
+;
+#endif
+
+/*
+ * Standard I/O file descriptors need special flag treatment since
+ * setting one to non-blocking does all on *BSD. Sigh. This array
+ * is used to store the initial flag settings.
+ */
+SCLASS int _pthread_stdio_flags[3];
+
/* File table information: */
SCLASS struct fd_table_entry **_thread_fd_table
#ifdef GLOBAL_PTHREAD_PRIVATE
@@ -558,7 +580,6 @@ void _thread_kern_sched_state(enum pthread_state,char *fname,int lineno);
void _thread_kern_set_timeout(struct timespec *);
void _thread_kern_sig_block(int *);
void _thread_kern_sig_unblock(int);
-void _thread_cleanup_pop(int);
void _thread_sig_handler(int, int, struct sigcontext *);
void _thread_start(void);
void _thread_start_sig_handler(void);
OpenPOWER on IntegriCloud