diff options
author | bje <bje> | 1998-07-24 12:06:28 +0000 |
---|---|---|
committer | bje <bje> | 1998-07-24 12:06:28 +0000 |
commit | 44a56b7d9a229b18b9f9886888eb344ee3f1ff99 (patch) | |
tree | 7d04b7e2105cc9363746b1cb74babc33a54c2323 /pthread.h | |
parent | 21e7d43d69e592cf909e4ae66971fc387b3bfc3b (diff) |
1998-07-24 Ben Elliston <bje@cygnus.com>
* pthread.h (SIG_BLOCK): Define if not already defined.
(SIG_UNBLOCK): Likewise.
(SIG_SETMASK): Likewise.
(pthread_attr_t): Add signal mask member.
(pthread_sigmask): Add function prototype.
* signal.c (pthread_sigmask): Implement.
* create.c: #include <string.h> to get a prototype for memcpy().
(pthread_create): New threads inherit their creator's signal
mask. Copy the signal mask to the new thread structure.
Diffstat (limited to 'pthread.h')
-rw-r--r-- | pthread.h | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -22,6 +22,22 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef _PTHREADS_H #define _PTHREADS_H +#ifdef HAVE_SIGNAL_H +#include <signal.h> +#endif /* HAVE_SIGNAL_H */ + +#ifndef SIG_BLOCK +#define SIG_BLOCK 0 +#endif /* SIG_BLOCK */ + +#ifndef SIG_UNBLOCK +#define SIG_BLOCK 1 +#endif /* SIG_UNBLOCK */ + +#ifndef SIG_SETMASK +#define SIG_SETMASK 2 +#endif /* SIG_SETMASK */ + #define PTHREAD_THREADS_MAX 128 #define PTHREAD_STACK_MIN 65535 @@ -72,6 +88,10 @@ typedef struct { int canceltype; /* PTHREAD_CANCEL_ASYNCHRONOUS PTHREAD_CANCEL_DEFERRED */ +#ifdef HAVE_SIGSET_T + sigset_t sigmask; +#endif /* HAVE_SIGSET_T */ + int priority; } pthread_attr_t; @@ -243,6 +263,12 @@ void *pthread_getspecific(pthread_key_t key); int pthread_key_delete(pthread_key_t key); +/* Signal handling. */ + +int pthread_sigmask(int how, + const sigset_t *set, + sigset_t *oset); + #ifdef __cplusplus } #endif /* __cplusplus */ |