* src/mm/gc-boehm.cpp: Define GC_SOLARIS_THREADS on Solaris.
[cacao.git] / src / threads / posix / thread-posix.cpp
index 031823ee561e9a7a6a3c2b3c62b4b138b43a3a50..a68cede39cf91c405bd86f2180fd3f137c519e65 100644 (file)
@@ -1,6 +1,6 @@
 /* src/threads/posix/thread-posix.cpp - POSIX thread functions
 
-   Copyright (C) 1996-2005, 2006, 2007, 2008
+   Copyright (C) 1996-2005, 2006, 2007, 2008, 2010
    CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
 
    This file is part of CACAO.
@@ -81,7 +81,6 @@
 #include "vm/jit/asmpart.h"
 
 #if defined(__DARWIN__)
-# include <mach/mach.h>
 
 typedef struct {
        Mutex* mutex;
@@ -99,6 +98,8 @@ typedef struct {
 # define GC_IRIX_THREADS
 #elif defined(__DARWIN__)
 # define GC_DARWIN_THREADS
+#elif defined(__SOLARIS__)
+# define GC_SOLARIS_THREADS
 #endif
 
 #if defined(ENABLE_GC_BOEHM)
@@ -584,8 +585,6 @@ void threads_impl_thread_free(threadobject *t)
 
 void threads_impl_preinit(void)
 {
-       int result;
-
        stopworldlock = new Mutex();
 
        /* initialize exit mutex and condition (on exit we join all
@@ -602,7 +601,7 @@ void threads_impl_preinit(void)
 #endif
 
 #if !defined(HAVE___THREAD)
-       result = pthread_key_create(&thread_current_key, NULL);
+       int result = pthread_key_create(&thread_current_key, NULL);
        if (result != 0)
                os::abort_errnum(result, "threads_impl_preinit: pthread_key_create failed");
 #endif