#ifndef WebCoreThread_h
#define WebCoreThread_h
#import <CoreGraphics/CoreGraphics.h>
#import <fenv.h>
#if defined(__cplusplus)
extern "C" {
#endif
typedef struct {
CGContextRef currentCGContext;
} WebThreadContext;
extern volatile bool webThreadShouldYield;
extern fenv_t mainThreadFEnv;
#ifdef __OBJC__
@class NSRunLoop;
#else
class NSRunLoop;
#endif
void WebThreadLock(void);
void WebThreadUnlock(void);
bool WebThreadIsLocked(void);
bool WebThreadIsLockedOrDisabled(void);
void WebThreadLockPushModal(void);
void WebThreadLockPopModal(void);
void WebThreadEnable(void);
bool WebThreadIsEnabled(void);
bool WebThreadIsCurrent(void);
bool WebThreadNotCurrent(void);
void WebThreadLockFromAnyThread();
void WebThreadLockFromAnyThreadNoLog();
void WebThreadUnlockFromAnyThread();
void WebThreadUnlockGuardForMail();
static inline bool WebThreadShouldYield(void) { return webThreadShouldYield; }
static inline void WebThreadSetShouldYield() { webThreadShouldYield = true; }
CFRunLoopRef WebThreadRunLoop(void);
NSRunLoop* WebThreadNSRunLoop(void);
WebThreadContext *WebThreadCurrentContext(void);
bool WebThreadContextIsCurrent(void);
void WebThreadSetDelegateSourceRunLoopMode(CFStringRef mode);
#if defined(__cplusplus)
}
#endif
#endif // WebCoreThread_h