summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbje <bje>1998-07-19 12:42:51 +0000
committerbje <bje>1998-07-19 12:42:51 +0000
commit8ceeeb02f5dd8ac90c98b348f169250fc1af34e4 (patch)
treed5d7085851e315fb3230a0cb094fd186f36dc762
parent6a4085ee02ab8bc5fa4388cede4ee73c1994567f (diff)
1998-07-19 Ben Elliston <bje@cygnus.com>
* pthread.h (pthread_key_t): Define this type. (pthread_key_create): Add function prototype. (pthread_setspecific): Likewise. (pthread_getspecific): Likwise. (pthread_key_delete): Likewise.
-rw-r--r--pthread.h14
1 files changed, 13 insertions, 1 deletions
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 */