#ifndef MainThread_h
#define MainThread_h
#include <functional>
#include <stdint.h>
namespace WTF {
typedef uint32_t ThreadIdentifier;
typedef void MainThreadFunction(void*);
WTF_EXPORT_PRIVATE void initializeMainThread();
WTF_EXPORT_PRIVATE void callOnMainThread(MainThreadFunction*, void* context);
WTF_EXPORT_PRIVATE void cancelCallOnMainThread(MainThreadFunction*, void* context);
WTF_EXPORT_PRIVATE void callOnMainThread(std::function<void ()>);
WTF_EXPORT_PRIVATE void setMainThreadCallbacksPaused(bool paused);
WTF_EXPORT_PRIVATE bool isMainThread();
WTF_EXPORT_PRIVATE bool canAccessThreadLocalDataForThread(ThreadIdentifier);
#if USE(WEB_THREAD)
WTF_EXPORT_PRIVATE bool isWebThread();
WTF_EXPORT_PRIVATE bool isUIThread();
WTF_EXPORT_PRIVATE void initializeWebThread();
WTF_EXPORT_PRIVATE void initializeApplicationUIThreadIdentifier();
WTF_EXPORT_PRIVATE void initializeWebThreadIdentifier();
void initializeWebThreadPlatform();
#else
inline bool isWebThread() { return isMainThread(); }
inline bool isUIThread() { return isMainThread(); }
#endif // USE(WEB_THREAD)
void initializeGCThreads();
#if ENABLE(PARALLEL_GC)
void registerGCThread();
WTF_EXPORT_PRIVATE bool isMainThreadOrGCThread();
#elif OS(DARWIN) && !PLATFORM(EFL) && !PLATFORM(GTK)
WTF_EXPORT_PRIVATE bool isMainThreadOrGCThread();
#else
inline bool isMainThreadOrGCThread() { return isMainThread(); }
#endif
void initializeMainThreadPlatform();
void scheduleDispatchFunctionsOnMainThread();
void dispatchFunctionsFromMainThread();
#if OS(DARWIN) && !PLATFORM(EFL) && !PLATFORM(GTK)
#if !USE(WEB_THREAD)
WTF_EXPORT_PRIVATE void initializeMainThreadToProcessMainThread();
#endif // !USE(WEB_THREAD)
void initializeMainThreadToProcessMainThreadPlatform();
#endif
}
using WTF::callOnMainThread;
using WTF::cancelCallOnMainThread;
using WTF::setMainThreadCallbacksPaused;
using WTF::isMainThread;
using WTF::isMainThreadOrGCThread;
using WTF::canAccessThreadLocalDataForThread;
using WTF::isUIThread;
using WTF::isWebThread;
#if USE(WEB_THREAD)
using WTF::initializeWebThread;
using WTF::initializeApplicationUIThreadIdentifier;
using WTF::initializeWebThreadIdentifier;
#endif
#endif // MainThread_h