summaryrefslogtreecommitdiff
path: root/implement.h
diff options
context:
space:
mode:
authorrpj <rpj>2002-01-08 02:21:06 +0000
committerrpj <rpj>2002-01-08 02:21:06 +0000
commit5f7ea668d6d4c96d9e0efea21ac5e300fda552ad (patch)
tree3d1f0fddfaf97bd6232edc9b05318d8daa0fca4c /implement.h
parent0337d817b128c648d97a79f42b303421b5b76386 (diff)
* mutex.c (pthread_mutex_trylock): use
ptw32_interlocked_compare_exchange function pointer rather than ptw32_InterlockedCompareExchange() directly to retain portability to non-iX86 processors, e.g. WinCE etc. The pointer will point to the native OS version of InterlockedCompareExchange() if the OS supports it (see ChangeLog entry of 2001-10-17).
Diffstat (limited to 'implement.h')
-rw-r--r--implement.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/implement.h b/implement.h
index e07306b..e075ee9 100644
--- a/implement.h
+++ b/implement.h
@@ -156,11 +156,17 @@ struct sem_t_ {
#define PTW32_OBJECT_INVALID NULL
struct pthread_mutex_t_ {
- LONG lock_idx;
- int recursive_count;
- int kind;
+ LONG lock_idx; /* Provides exclusive access to mutex state
+ via the Interlocked* mechanism, as well
+ as a count of the number of threads
+ waiting on the mutex. */
+ int recursive_count; /* Number of unlocks a thread needs to perform
+ before the lock is released (recursive
+ mutexes only). */
+ int kind; /* Mutex type. */
pthread_t ownerThread;
- HANDLE wait_sema;
+ HANDLE wait_sema; /* Mutex release notification to waiting
+ threads. */
};
struct pthread_mutexattr_t_ {