summaryrefslogtreecommitdiff
path: root/pthread.h
diff options
context:
space:
mode:
authorbje <bje>1998-07-12 13:56:37 +0000
committerbje <bje>1998-07-12 13:56:37 +0000
commit88e6447287d592f763421753b759e861996e95de (patch)
treea209093d3fbc37fe6c5eaba4c5038e72bbd3677c /pthread.h
parentd2b7bdcbe575ac913299dacaccfc0b3161d8162f (diff)
1998-07-13 Ben Elliston <bje@cygnus.com>
* pthread.h (pthread_mutex_t): Define this type. (pthread_mutex_destroy): Add function prototype. (pthread_lock): Likewise. (pthread_trylock): Likewise. (pthread_unlock): Likewise.
Diffstat (limited to 'pthread.h')
-rw-r--r--pthread.h14
1 files changed, 14 insertions, 0 deletions
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. */