s/pthread_mutex_t/mono_mutex_t in some header files too
authorJeffrey Stedfast <fejj@novell.com>
Wed, 13 Feb 2002 15:33:44 +0000 (15:33 -0000)
committerJeffrey Stedfast <fejj@novell.com>
Wed, 13 Feb 2002 15:33:44 +0000 (15:33 -0000)
svn path=/trunk/mono/; revision=2378

mono/io-layer/critical-sections.h
mono/io-layer/mono-mutex.c
mono/io-layer/timed-thread.h
mono/io-layer/wait-private.h

index e377ce3c5a12d7ab74877777a9baf67635774fbd..b9fdfd5abb8dc7b31b0b536a9063845c9e831e82 100644 (file)
@@ -1,15 +1,19 @@
 #ifndef _WAPI_CRITICAL_SECTIONS_H_
 #define _WAPI_CRITICAL_SECTIONS_H_
 
+#include <config.h>
+
 #include <glib.h>
 #include <pthread.h>
 
+#include "mono-mutex.h"
+
 typedef struct _WapiCriticalSection WapiCriticalSection;
 
 struct _WapiCriticalSection
 {
        guint32 depth;
-       pthread_mutex_t mutex;
+       mono_mutex_t mutex;
 };
 
 extern void InitializeCriticalSection(WapiCriticalSection *section);
index e314274e991676e45e8b718d501a4b6a843579b2..4a64841dfe1199dcb4367aa92d0848327948da30 100644 (file)
@@ -28,6 +28,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
+#include <assert.h>
 
 #include "mono-mutex.h"
 
@@ -269,7 +270,7 @@ mono_mutex_unlock (mono_mutex_t *mutex)
                if (pthread_mutex_lock (&mutex->mutex) != 0)
                        return EINVAL;
                
-               g_assert (mutex->owner == pthread_self ());
+               assert (mutex->owner == pthread_self ());
                
                mutex->depth--;
                if (mutex->depth == 0) {
@@ -312,7 +313,7 @@ mono_cond_wait (pthread_cond_t *cond, mono_mutex_t *mutex)
 int
 mono_cond_timedwait (pthread_cond_t *cond, mono_mutex_t *mutex, const struct timespec *timeout)
 {
-       return pthread_cond_wait (cond, &mutex->mutex, timeout);
+       return pthread_cond_timedwait (cond, &mutex->mutex, timeout);
 }
 
 #endif /* USE_MONO_MUTEX */
index bb5908058c24cd613dc4c53c4745f589b78873c6..683472317e38e992fc3fd0a1774e29a96fcf020e 100644 (file)
@@ -5,10 +5,12 @@
 #include <glib.h>
 #include <pthread.h>
 
+#include "mono-mutex.h"
+
 typedef struct
 {
        pthread_t id;
-       pthread_mutex_t join_mutex;
+       mono_mutex_t join_mutex;
        pthread_cond_t exit_cond;
        guint32 (*start_routine)(gpointer arg);
        void (*exit_routine)(guint32 exitstatus, gpointer userdata);
index a3b352eec7fab67c8e4fc3851b5046b71e5bfed7..1f96f7c2b8ebbfaa6487d5623a40210044661421 100644 (file)
@@ -3,6 +3,8 @@
 
 /* This is an internal, private header file */
 
+#include <config.h>
+
 #include <glib.h>
 #include <pthread.h>
 #include <semaphore.h>
@@ -10,6 +12,8 @@
 #include "wapi-private.h"
 #include "timed-thread.h"
 
+#include "mono-mutex.h"
+
 typedef enum {
        WQ_NEW,
        WQ_WAITING,
@@ -18,7 +22,7 @@ typedef enum {
 
 typedef struct _WaitQueueItem 
 {
-       pthread_mutex_t mutex;
+       mono_mutex_t mutex;
        sem_t wait_sem;
        WaitQueueState state;
        guint32 update, ack;