From 88e6447287d592f763421753b759e861996e95de Mon Sep 17 00:00:00 2001 From: bje Date: Sun, 12 Jul 1998 13:56:37 +0000 Subject: 1998-07-13 Ben Elliston * pthread.h (pthread_mutex_t): Define this type. (pthread_mutex_destroy): Add function prototype. (pthread_lock): Likewise. (pthread_trylock): Likewise. (pthread_unlock): Likewise. --- pthread.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'pthread.h') diff --git a/pthread.h b/pthread.h index e3abbfb..37cb9f8 100644 --- a/pthread.h +++ b/pthread.h @@ -26,6 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define PTHREAD_PROCESS_SHARED 1 typedef HANDLE pthread_t; +typedef HANDLE pthread_mutex_t; typedef struct { void * ptr; } pthread_mutexattr_t; #ifdef __cplusplus @@ -57,6 +58,19 @@ int pthread_mutexattr_setpshared(pthread_mutexattr_t *attr, int pthread_mutexattr_getpshared(pthread_mutexattr_t *attr, int *pshared); +/* Primitives for mutexes. */ + +int pthread_mutex_init(pthread_mutex_t *mutex, + pthread_mutex_attr_t *attr); + +int pthread_mutex_destroy(pthread_mutex_t *mutex); + +int pthread_mutex_lock(pthread_mutex_t *mutex); + +int pthread_mutex_trylock(pthread_mutex_t *mutex); + +int pthread_mutex_unlock(pthread_mutex_t *mutex); + /* These functions cannot be implemented in terms of the Win32 API. Fortunately they are optional. Their implementation just returns the correct error number. */ -- cgit v1.2.3