diff options
author | bje <bje> | 1998-07-23 15:53:17 +0000 |
---|---|---|
committer | bje <bje> | 1998-07-23 15:53:17 +0000 |
commit | c26c1fc4518a166d12854aba5fe20688fcf37e8c (patch) | |
tree | 971211646ed3068857817bc86900241caf29152a /pthread.h | |
parent | ad204c1d96ff23ab2421b8890d984fe5d78f690b (diff) |
1998-07-24 Ben Elliston <bje@cygnus.com>
* 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.
Diffstat (limited to 'pthread.h')
-rw-r--r-- | pthread.h | 20 |
1 files changed, 16 insertions, 4 deletions
@@ -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); |