projects
/
cacao.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* src/threads/mutex.h: Renamed to...
[cacao.git]
/
src
/
threads
/
thread.h
diff --git
a/src/threads/thread.h
b/src/threads/thread.h
index 309de1a9bc9d4d7216b14d154f67355f56a04393..6d4e02e319dfdbc2cdcd5d7736f983edb9049ae6 100644
(file)
--- a/
src/threads/thread.h
+++ b/
src/threads/thread.h
@@
-28,8
+28,14
@@
#include "config.h"
#include "config.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include "vmcore/system.h"
#include "vmcore/system.h"
+#include "threads/mutex.hpp"
+
#if defined(ENABLE_THREADS)
# include "threads/posix/thread-posix.h"
#else
#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. */
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;
interrupted = t->interrupted;
-
mutex_unlock(&
t->waitmutex);
+
Mutex_unlock(
t->waitmutex);
return interrupted;
}
return interrupted;
}
@@
-231,13
+237,13
@@
inline static bool thread_is_interrupted(threadobject *t)
inline static void thread_set_interrupted(threadobject *t, bool interrupted)
{
inline static void thread_set_interrupted(threadobject *t, bool interrupted)
{
-
mutex_lock(&
t->waitmutex);
+
Mutex_lock(
t->waitmutex);
/* Set interrupted flag. */
t->interrupted = interrupted;
/* 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 */
#endif /* ENABLE_THREADS */
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _THREAD_H */
#endif /* _THREAD_H */