summaryrefslogtreecommitdiff
path: root/pthread.h
diff options
context:
space:
mode:
authorrpj <rpj>1998-08-03 15:27:21 +0000
committerrpj <rpj>1998-08-03 15:27:21 +0000
commit10f173691b6929033d5714cde8a33f4477aaba28 (patch)
tree4b84ccc5f4226332d00aea6b41f98013deaf7b31 /pthread.h
parentbd354ffc95e1f3ef53f781b9c15641d9b6da9208 (diff)
Tue Aug 4 00:09:30 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
* implement.h(_pthread_virgins): Add extern. (_pthread_virgin_next): Ditto. (_pthread_reuse): Ditto. (_pthread_reuse_top): Ditto. (_pthread_win32handle_map): Ditto. (_pthread_threads_mutex_table): Ditto. * global.c (_pthread_virgins): Changed from array to pointer. Storage allocation for the array moved into dll.c. (_pthread_reuse): Ditto. (_pthread_win32handle_map): Ditto. (_pthread_threads_mutex_table): Ditto. * dll.c (PthreadsEntryPoint): Set up thread admin storage when DLL is loaded. * fork.c (pthread_atfork): Fix function pointer arg to all _pthread_handler_push() calls. Change "arg" arg to NULL in child push. * exit.c: Add windows.h and process.h includes. (_pthread_exit): Add local detachstate declaration. (_pthread_exit): Fix incorrect name for pthread_attr_getdetachstate(). * pthread.h (_POSIX_THREAD_ATTR_STACKSIZE): Move from global.c (_POSIX_THREAD_ATTR_STACKADDR): Ditto. * create.c (pthread_create): Fix #if should be #ifdef. (_pthread_start_call): Remove usused variables. * process.h: Create. * windows.h: Move _beginthreadex and _endthreadex into process.h Mon Aug 3 21:19:57 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> * condvar.c (pthread_cond_init): Add NULL attr to pthread_mutex_init() call - default attributes will be used. (cond_wait): Fix typo. (cond_wait): Fix typo - cv was ev. (pthread_cond_broadcast): Fix two identical typos. * cleanup.c (_pthread_destructor_pop_all): Remove _ prefix from PTHREAD_DESTRUCTOR_ITERATIONS. * pthread.h: Move _POSIX_* values into posix.h * pthread.h: Fix typo in pthread_mutex_init() prototype. * attr.c (pthread_attr_init): Fix error in priority member init. * windows.h (THREAD_PRIORITY_NORMAL): Add. * pthread.h (sched_param): Add missing ';' to struct definition. * attr.c (pthread_attr_init): Remove obsolete pthread_attr_t member initialisation - cancelstate, canceltype, cancel_pending. (is_attr): Make arg "attr" a const. * implement.h (_PTHREAD_HANDLER_POP_LIFO): Remove definition. (_PTHREAD_HANDLER_POP_FIFO): Ditto. (_PTHREAD_VALID): Add missing newline escape (\). (_pthread_handler_node): Make element "next" a pointer.
Diffstat (limited to 'pthread.h')
-rw-r--r--pthread.h27
1 files changed, 17 insertions, 10 deletions
diff --git a/pthread.h b/pthread.h
index bad53a5..dc085c3 100644
--- a/pthread.h
+++ b/pthread.h
@@ -22,6 +22,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef _PTHREADS_H
#define _PTHREADS_H
+/* Convert these to defined when implemented. */
+#define _POSIX_THREAD_ATTR_STACKSIZE
+#ifdef _POSIX_THREAD_ATTR_STACKADDR
+#undef _POSIX_THREAD_ATTR_STACKADDR
+#endif
+
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif /* HAVE_CONFIG_H */
@@ -46,15 +52,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define SIG_SETMASK 2
#endif /* SIG_SETMASK */
-#define PTHREAD_THREADS_MAX 128
#define PTHREAD_STACK_MIN 65535
-/* Convert these to defined when implemented. */
-#define _POSIX_THREAD_ATTR_STACKSIZE
-#ifdef _POSIX_THREAD_ATTR_STACKADDR
-#undef _POSIX_THREAD_ATTR_STACKADDR
-#endif
-
/* Thread scheduling policies */
#define SCHED_OTHER 0
@@ -98,7 +97,7 @@ typedef struct {
called. */
struct sched_param {
int sched_priority;
-}
+};
enum { SIGNAL, BROADCAST, NUM_EVENTS };
@@ -233,7 +232,7 @@ int pthread_cond_destroy(pthread_cond_t *cv);
/* Primitives for mutexes. */
int pthread_mutex_init(pthread_mutex_t *mutex,
- pthread_mutex_attr_t *attr);
+ pthread_mutexattr_t *attr);
int pthread_mutex_destroy(pthread_mutex_t *mutex);
@@ -270,16 +269,24 @@ int pthread_cancel(pthread_t thread);
}
#endif /* __cplusplus */
+/* Constants declared in global.c */
+extern const int _POSIX_THREAD_THREADS_MAX;
+extern const int _POSIX_THREAD_DESTRUCTOR_ITERATIONS;
+extern const int _POSIX_THREAD_KEYS_MAX;
+
extern const int _pthread_create_joinable;
extern const int _pthread_create_detached;
-/* Cancelability attributes */
extern const int _pthread_cancel_enable;
extern const int _pthread_cancel_disable;
extern const int _pthread_cancel_asynchronous;
extern const int _pthread_cancel_deferred;
+#define PTHREAD_DESTRUCTOR_ITERATIONS _POSIX_THREAD_DESTRUCTOR_ITERATIONS
+#define PTHREAD_KEYS_MAX _POSIX_THREAD_KEYS_MAX
+#define PTHREAD_THREADS_MAX _POSIX_THREAD_THREADS_MAX
+
#define PTHREAD_CREATE_JOINABLE _pthread_create_joinable
#define PTHREAD_CREATE_DETACHED _pthread_create_detached