#include "mm/memory.h"
-#include "threads/mutex.h"
+#include "threads/mutex.hpp"
#include "threads/threadlist.h"
-#include "threads/thread.h"
+#include "threads/thread.hpp"
#include "toolbox/list.h"
-#include "vmcore/options.h"
+#include "vm/options.h"
/* global variables ***********************************************************/
-static mutex_t threadlist_mutex; /* global mutex for the thread list */
+static Mutex* threadlist_mutex; /* global mutex for the thread list */
static list_t *list_thread; /* global threads list */
static list_t *list_thread_free; /* global free threads list */
/* Initialize the thread list mutex. */
- mutex_init(&threadlist_mutex);
+ threadlist_mutex = Mutex_new();
/* Initialize the thread lists. */
void threadlist_lock(void)
{
- mutex_lock(&threadlist_mutex);
+ Mutex_lock(threadlist_mutex);
}
void threadlist_unlock(void)
{
- mutex_unlock(&threadlist_mutex);
+ Mutex_unlock(threadlist_mutex);
}