summaryrefslogtreecommitdiff
path: root/pthread.h
diff options
context:
space:
mode:
authorrpj <rpj>1998-07-23 17:12:12 +0000
committerrpj <rpj>1998-07-23 17:12:12 +0000
commit63ed0e78ffb72a9f425928344355c2159830b5af (patch)
tree391078160e36b786d62c3505fd2c410607924f79 /pthread.h
parent5b4731d25e148347d190d8ceb5f3f7aa2a7dac86 (diff)
Fri Jul 24 03:00:25 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
* attr.c (pthread_attr_destroy): Fix merge conflicts. (pthread_attr_getdetachstate): Fix merge conflicts. (pthread_attr_setdetachstate): Fix merge conflicts. * pthread.h: Fix merge conflicts. * sync.c (pthread_join): Fix merge conflicts.
Diffstat (limited to 'pthread.h')
-rw-r--r--pthread.h54
1 files changed, 18 insertions, 36 deletions
diff --git a/pthread.h b/pthread.h
index 7f0ba89..dc3c608 100644
--- a/pthread.h
+++ b/pthread.h
@@ -58,19 +58,22 @@ typedef DWORD pthread_key_t;
/* Related constants */
typedef struct {
long valid;
+
#ifdef _POSIX_THREAD_ATTR_STACKSIZE
size_t stacksize; /* PTHREAD_STACK_MIN */
#endif
+
int cancelability; /* PTHREAD_CANCEL_DISABLE
PTHREAD_CANCEL_ENABLE */
+ int detached; /* PTHREAD_CREATE_DETACHED
+ PTHREAD_CREATE_JOINABLE */
+
int canceltype; /* PTHREAD_CANCEL_ASYNCHRONOUS
PTHREAD_CANCEL_DEFERRED */
- int detached; /* PTHREAD_CREATE_JOINABLE
- PTHREAD_CREATE_DETACHED */
-
int priority;
+
} pthread_attr_t;
/* I don't know why this structure isn't in some kind of namespace.
@@ -122,6 +125,8 @@ int pthread_equal(pthread_t t1, pthread_t t2);
int pthread_join(pthread_t thread, void ** valueptr);
+int pthread_detach(pthread_t thread);
+
int pthread_once(pthread_once_t *once_control, void (*init_routine)(void));
/* Functions for manipulating thread attribute objects. */
@@ -238,22 +243,6 @@ void *pthread_getspecific(pthread_key_t key);
int pthread_key_delete(pthread_key_t key);
-
-/* Internal primitives that must be here. */
-
-/* Generic handler push and pop routines. */
-
-void _pthread_handler_push(_pthread_handler_node_t ** stacktop,
- int poporder,
- void (*routine)(void *),
- void *arg);
-
-void _pthread_handler_pop(_pthread_handler_node_t ** stacktop,
- int execute);
-
-void _pthread_handler_pop_all(_pthread_handler_node_t ** stacktop,
- int execute);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
@@ -266,13 +255,21 @@ void _pthread_handler_pop_all(_pthread_handler_node_t ** stacktop,
POSIX requires that applications observe scoping requirements, but
doesn't say if the implemention must enforce them. The macros below
- partially enforce scope but can lead to compile or runtime errors.
- */
+ partially enforce scope but can lead to compile or runtime errors. */
+
enum {
_PTHREAD_HANDLER_POP_LIFO,
_PTHREAD_HANDLER_POP_FIFO
};
+enum {
+ _PTHREAD_CLEANUP_STACK,
+ _PTHREAD_DESTRUCTOR_STACK,
+ _PTHREAD_FORKPREPARE_STACK,
+ _PTHREAD_FORKPARENT_STACK,
+ _PTHREAD_FORKCHILD_STACK
+};
+
#ifdef pthread_cleanup_push
#undef pthread_cleanup_push
#endif
@@ -290,19 +287,4 @@ enum {
_pthread_handler_pop(_PTHREAD_CLEANUP_STACK, execute);\
}
-
-/* Global data needed by the application but which must not be static
- in the DLL. */
-
-extern pthread_mutex_t _pthread_count_mutex;
-
-extern DWORD _pthread_threads_count;
-
-extern _pthread_threads_thread_t _pthread_threads_table[];
-
-extern unsigned short _pthread_once_flag;
-
-extern pthread_mutex_t _pthread_once_lock;
-
-
#endif /* _PTHREADS_H */