* src/threads/mutex.h: Renamed to...
[cacao.git] / src / threads / thread.h
index 309de1a9bc9d4d7216b14d154f67355f56a04393..6d4e02e319dfdbc2cdcd5d7736f983edb9049ae6 100644 (file)
 
 #include "config.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "vmcore/system.h"
 
+#include "threads/mutex.hpp"
+
 #if defined(ENABLE_THREADS)
 # include "threads/posix/thread-posix.h"
 #else
@@ -212,9 +218,9 @@ inline static bool thread_is_interrupted(threadobject *t)
           a blocking system call is interrupted. The mutex ensures that it will
           see the correct value for the interrupted flag. */
 
-       mutex_lock(&t->waitmutex);
+       Mutex_lock(t->waitmutex);
        interrupted = t->interrupted;
-       mutex_unlock(&t->waitmutex);
+       Mutex_unlock(t->waitmutex);
 
        return interrupted;
 }
@@ -231,13 +237,13 @@ inline static bool thread_is_interrupted(threadobject *t)
 
 inline static void thread_set_interrupted(threadobject *t, bool interrupted)
 {
-       mutex_lock(&t->waitmutex);
+       Mutex_lock(t->waitmutex);
 
        /* Set interrupted flag. */
 
        t->interrupted = interrupted;
 
-       mutex_unlock(&t->waitmutex);
+       Mutex_unlock(t->waitmutex);
 }
 
 
@@ -345,6 +351,10 @@ void          threads_yield(void);
 
 #endif /* ENABLE_THREADS */
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _THREAD_H */