rx-windows-mutex-is-mine-20080925
authorJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 25 Sep 2008 12:49:10 +0000 (12:49 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 25 Sep 2008 12:49:10 +0000 (12:49 +0000)
LICENSE MIT

Add MUTEX_IS_MINE for Windows

src/rx/rx_pthread.h

index 6ae4af7..ff53183 100644 (file)
 
 typedef pthread_mutex_t afs_kmutex_t;
 typedef pthread_cond_t afs_kcondvar_t;
-#define MUTEX_ISMINE
+#ifdef RX_ENABLE_LOCKS
+#define MUTEX_ISMINE(l) (pthread_mutex_trylock(l) == EDEADLK)
+#else
+#define MUTEX_ISMINE(l) (1)
+#endif
+
 #define pthread_yield() Sleep(0)
 
 #else /* AFS_NT40_ENV */