Flush
[mono.git] / mono / io-layer / mono-mutex.h
index 8e233167629ef3bc4ac7956f8fa49260a62c288b..3c4ba577fff5c2255c574820fe09d81349a975dc 100644 (file)
@@ -33,12 +33,6 @@ extern "C" {
 #include <pthread.h>
 #include <time.h>
 
-#ifndef HAVE_PTHREAD_MUTEX_TIMEDLOCK
-extern int pthread_mutex_timedlock (pthread_mutex_t *mutex,
-                                   const struct timespec *timeout);
-#endif /* HAVE_PTHREAD_MUTEX_TIMEDLOCK */
-
-
 typedef struct {
        pthread_mutex_t mutex;
        gboolean complete;
@@ -165,6 +159,14 @@ typedef pthread_mutexattr_t mono_mutexattr_t;
 
 #endif /* USE_MONO_MUTEX */
 
+/* This is a function so it can be passed to pthread_cleanup_push -
+ * that is a macro and giving it a macro as a parameter breaks.
+ */
+static inline int mono_mutex_unlock_in_cleanup (mono_mutex_t *mutex)
+{
+       return(mono_mutex_unlock (mutex));
+}
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */