From c26c1fc4518a166d12854aba5fe20688fcf37e8c Mon Sep 17 00:00:00 2001 From: bje Date: Thu, 23 Jul 1998 15:53:17 +0000 Subject: 1998-07-24 Ben Elliston * pthread.h (PTHREAD_CREATE_JOINABLE): Define. (PTHREAD_CREATE_DETACHED): Likewise. (pthread_attr_t): Add new structure member `detached'. (pthread_attr_getdetachstate): Add function prototype. (pthread_attr_setdetachstate): Likewise. --- pthread.h | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/pthread.h b/pthread.h index b1f61d3..7f0ba89 100644 --- a/pthread.h +++ b/pthread.h @@ -40,12 +40,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define SCHED_MIN SCHED_OTHER #define SCHED_MAX SCHED_RR +#define PTHREAD_CREATE_JOINABLE 0 +#define PTHREAD_CREATE_DETACHED 1 + /* Cancelability attributes */ -#define PTHREAD_CANCEL_ENABLE 0x00 -#define PTHREAD_CANCEL_DISABLE 0x01 +#define PTHREAD_CANCEL_ENABLE 0 +#define PTHREAD_CANCEL_DISABLE 1 -#define PTHREAD_CANCEL_ASYNCHRONOUS 0x00 -#define PTHREAD_CANCEL_DEFERRED 0x01 +#define PTHREAD_CANCEL_ASYNCHRONOUS 0 +#define PTHREAD_CANCEL_DEFERRED 1 typedef HANDLE pthread_t; typedef CRITICAL_SECTION pthread_mutex_t; @@ -64,6 +67,9 @@ typedef struct { int canceltype; /* PTHREAD_CANCEL_ASYNCHRONOUS PTHREAD_CANCEL_DEFERRED */ + int detached; /* PTHREAD_CREATE_JOINABLE + PTHREAD_CREATE_DETACHED */ + int priority; } pthread_attr_t; @@ -142,6 +148,12 @@ int pthread_attr_getschedparam(const pthread_attr_t *attr, int pthread_attr_setschedparam(pthread_attr_t *attr, const struct sched_param *param); +int pthread_attr_getdetachstate(const pthread_attr_t *attr, + int *detachstate); + +int pthread_attr_setdetachstate(pthread_attr_t *attr, + int detachstate); + int pthread_setschedparam(pthread_t thread, int policy, const struct sched_param *param); -- cgit v1.2.3