diff options
author | bje <bje> | 1998-07-12 13:56:37 +0000 |
---|---|---|
committer | bje <bje> | 1998-07-12 13:56:37 +0000 |
commit | 88e6447287d592f763421753b759e861996e95de (patch) | |
tree | a209093d3fbc37fe6c5eaba4c5038e72bbd3677c /pthread.h | |
parent | d2b7bdcbe575ac913299dacaccfc0b3161d8162f (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.h | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -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. */ |