]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - heap/MachineStackMarker.h
JavaScriptCore-1218.34.tar.gz
[apple/javascriptcore.git] / heap / MachineStackMarker.h
index c814ac5510e9d95f3a36c8eda42494f47443605f..44ad8b6c620363172c41121269583bbf287f84a5 100644 (file)
 #define MachineThreads_h
 
 #include <wtf/Noncopyable.h>
+#include <wtf/ThreadSpecific.h>
 #include <wtf/ThreadingPrimitives.h>
 
-#if ENABLE(JSC_MULTIPLE_THREADS)
-#include <pthread.h>
-#endif
-
 namespace JSC {
 
-    class Heap;
     class ConservativeRoots;
+    class Heap;
 
     class MachineThreads {
         WTF_MAKE_NONCOPYABLE(MachineThreads);
@@ -42,29 +39,28 @@ namespace JSC {
 
         void gatherConservativeRoots(ConservativeRoots&, void* stackCurrent);
 
-#if ENABLE(JSC_MULTIPLE_THREADS)
+#if PLATFORM(IOS)
+        JS_EXPORT_PRIVATE void makeUsableFromMultipleThreads();
+#else
         void makeUsableFromMultipleThreads();
-        void addCurrentThread(); // Only needs to be called by clients that can use the same heap from multiple threads.
 #endif
+        JS_EXPORT_PRIVATE void addCurrentThread(); // Only needs to be called by clients that can use the same heap from multiple threads.
 
     private:
         void gatherFromCurrentThread(ConservativeRoots&, void* stackCurrent);
 
-#if ENABLE(JSC_MULTIPLE_THREADS)
         class Thread;
 
         static void removeThread(void*);
         void removeCurrentThread();
 
         void gatherFromOtherThread(ConservativeRoots&, Thread*);
-#endif
-
-        Heap* m_heap;
 
-#if ENABLE(JSC_MULTIPLE_THREADS)
         Mutex m_registeredThreadsMutex;
         Thread* m_registeredThreads;
-        pthread_key_t m_threadSpecific;
+        WTF::ThreadSpecificKey m_threadSpecific;
+#if !ASSERT_DISABLED
+        Heap* m_heap;
 #endif
     };