From 8ceeeb02f5dd8ac90c98b348f169250fc1af34e4 Mon Sep 17 00:00:00 2001 From: bje Date: Sun, 19 Jul 1998 12:42:51 +0000 Subject: 1998-07-19 Ben Elliston * pthread.h (pthread_key_t): Define this type. (pthread_key_create): Add function prototype. (pthread_setspecific): Likewise. (pthread_getspecific): Likwise. (pthread_key_delete): Likewise. --- pthread.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'pthread.h') diff --git a/pthread.h b/pthread.h index b41e3c7..8137f53 100644 --- a/pthread.h +++ b/pthread.h @@ -24,6 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. typedef HANDLE pthread_t; typedef CRITICAL_SECTION pthread_mutex_t; +typedef DWORD pthread_key_t; typedef struct { enum { SIGNAL, BROADCAST, NUM_EVENTS }; @@ -34,7 +35,7 @@ typedef struct { /* Count of the number of waiters. */ unsigned waiters_count; - /* Serialize access to waiters_count_. */ + /* Serialize access to waiters_count. */ pthread_mutex_t waiters_count_lock; } pthread_cond_t; @@ -147,6 +148,17 @@ int pthread_mutexattr_setprioceiling(pthread_mutexattr_t *attr, int pthread_mutexattr_getprioceiling(const pthread_mutexattr_t *attr, int *ceiling); +/* Primitives for thread-specific data (TSD). */ + +int pthread_key_create(pthread_key_t *key, + void (*destructor)(void *)); + +int pthread_setspecific(pthread_key_t key, void *value); + +void *pthread_getspecific(pthread_key_t key); + +int pthread_key_delete(pthread_key_t key); + #ifdef __cplusplus } #endif /* __cplusplus */ -- cgit v1.2.3