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