diff options
author | David Leonard <d@cvs.openbsd.org> | 1999-01-18 00:00:34 +0000 |
---|---|---|
committer | David Leonard <d@cvs.openbsd.org> | 1999-01-18 00:00:34 +0000 |
commit | 7b9d8c26923e22e249d8fccca1b678c46ca2b4de (patch) | |
tree | 28ebd21a982d7c31007aa22724282631b071b210 /lib/libpthread/uthread | |
parent | 46b689c0962ca1c667dfdfc76b8e6fafc1eef2bc (diff) |
sync with previous changes
Diffstat (limited to 'lib/libpthread/uthread')
-rw-r--r-- | lib/libpthread/uthread/Makefile.inc | 9 | ||||
-rw-r--r-- | lib/libpthread/uthread/pthread_private.h | 41 |
2 files changed, 39 insertions, 11 deletions
diff --git a/lib/libpthread/uthread/Makefile.inc b/lib/libpthread/uthread/Makefile.inc index bbaea92c049..e525110ebb3 100644 --- a/lib/libpthread/uthread/Makefile.inc +++ b/lib/libpthread/uthread/Makefile.inc @@ -1,5 +1,5 @@ -# $Id: Makefile.inc,v 1.5 1999/01/08 05:42:18 d Exp $ -# $OpenBSD: Makefile.inc,v 1.5 1999/01/08 05:42:18 d Exp $ +# $Id: Makefile.inc,v 1.6 1999/01/18 00:00:32 d Exp $ +# $OpenBSD: Makefile.inc,v 1.6 1999/01/18 00:00:32 d Exp $ # uthread sources .PATH: ${.CURDIR}/uthread @@ -8,17 +8,21 @@ CFLAGS += -I${.CURDIR}/arch/${MACHINE_ARCH} SRCS+= \ uthread_accept.c \ + uthread_atfork.c \ uthread_attr_destroy.c \ uthread_attr_init.c \ uthread_attr_getdetachstate.c \ uthread_attr_getstackaddr.c \ uthread_attr_getstacksize.c \ + uthread_attr_priosched.c \ uthread_attr_setcreatesuspend_np.c \ uthread_attr_setdetachstate.c \ uthread_attr_setstackaddr.c \ uthread_attr_setstacksize.c \ uthread_autoinit.c \ uthread_bind.c \ + uthread_fchflags.c \ + uthread_cancel.c \ uthread_clean.c \ uthread_close.c \ uthread_cond.c \ @@ -60,6 +64,7 @@ SRCS+= \ uthread_listen.c \ uthread_mattr_init.c \ uthread_mattr_kind_np.c \ + uthread_msync.c \ uthread_multi_np.c \ uthread_mutex.c \ uthread_mutexattr_destroy.c \ diff --git a/lib/libpthread/uthread/pthread_private.h b/lib/libpthread/uthread/pthread_private.h index 28cfcfa7ae7..ff318b3b611 100644 --- a/lib/libpthread/uthread/pthread_private.h +++ b/lib/libpthread/uthread/pthread_private.h @@ -31,7 +31,7 @@ * * Private thread definitions for the uthread kernel. * - * $OpenBSD: pthread_private.h,v 1.10 1999/01/10 22:32:23 d Exp $ + * $OpenBSD: pthread_private.h,v 1.11 1999/01/18 00:00:32 d Exp $ * */ @@ -50,7 +50,9 @@ #include <sys/time.h> #include <sched.h> #include <spinlock.h> +#ifndef _NO_UTHREAD_MACHDEP #include "uthread_machdep.h" +#endif /* * Kernel fatal error handler macro. @@ -197,6 +199,10 @@ struct pthread_attr { #define PTHREAD_MIN_PRIORITY 0 #define _POSIX_THREAD_ATTR_STACKSIZE +#define PTHREAD_ATFORK_PREPARE 0 +#define PTHREAD_ATFORK_PARENT 1 +#define PTHREAD_ATFORK_CHILD 2 + /* * Clock resolution in nanoseconds. */ @@ -349,12 +355,6 @@ struct pthread { */ struct sigcontext saved_sigcontext; - /* - * Saved jump buffer used in call to longjmp by _thread_kern_sched - * if sig_saved is FALSE. - */ - jmp_buf saved_jmp_buf; - /* * TRUE if the last state saved was a signal context. FALSE if the * last state saved was a jump buffer. @@ -362,6 +362,12 @@ struct pthread { int sig_saved; /* + * Cancelability state. + */ + int cancelstate; + int canceltype; + + /* * Current signal mask and pending signals. */ sigset_t sigmask; @@ -441,8 +447,10 @@ struct pthread { int signo; /* Miscellaneous data. */ - char flags; -#define PTHREAD_EXITING 0x0100 + int flags; +#define PTHREAD_EXITING (0x0100) +#define PTHREAD_CANCELLING (0x0200) /* thread has been cancelled */ +#define PTHREAD_AT_CANCEL_POINT (0x0400) /* thread at cancel point */ char pthread_priority; void *ret; const void **specific_data; @@ -453,8 +461,16 @@ struct pthread { const char *fname; /* Ptr to source file name */ int lineno; /* Source line number. */ + /* + * Saved jump buffer used in call to longjmp by _thread_kern_sched + * if sig_saved is FALSE. + */ + _machdep_jmp_buf saved_jmp_buf; + +#ifndef _UTHREAD_MACHDEP /* Machine dependent information */ struct _machdep_struct _machdep; +#endif }; /* @@ -577,6 +593,10 @@ 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); +void _thread_enter_cancellation_point(void); +void _thread_leave_cancellation_point(void); +void _thread_cancellation_point(void); +void _thread_atfork(int); /* #include <signal.h> */ #ifdef _USER_SIGNAL_H @@ -761,6 +781,9 @@ pid_t _thread_sys_wait4(pid_t, int *, int, struct rusage *); int _thread_sys_poll(struct pollfd[], int, int); #endif +/* #include <sys/mman.h> */ +int _thread_sys_msync(void *, size_t, int); + __END_DECLS #endif /* !_PTHREAD_PRIVATE_H */ |