#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);
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
};