ThreadUtilities.h revision 6055
4639N/A * or visit www.oracle.com if you need additional information or have any
4639N/A#ifndef __THREADUTILITIES_H
4639N/A#define __THREADUTILITIES_H
4639N/A#ifndef PRODUCT_BUILD
4639N/A#define AWT_THREAD_ASSERTS
4639N/A#ifdef AWT_THREAD_ASSERTS
4639N/Aextern int sAWTThreadAsserts;
4639N/A if (sAWTThreadAsserts) { \
4639N/A NSLog(@"\tPlease run this java program again with setenv COCOA_AWT_DISABLE_THREAD_ASSERTS to proceed with a warning."); \
4639N/A#define AWT_THREAD_ASSERTS_ENV_ASSERT_CHECK do {} while (0)
4639N/A#define AWT_ASSERT_APPKIT_THREAD \
4639N/A if (pthread_main_np() == 0) { \
4639N/A#define AWT_ASSERT_NOT_APPKIT_THREAD \
4639N/A if (pthread_main_np() != 0) { \
4639N/A#define AWT_ASSERT_APPKIT_THREAD \
4639N/A while (pthread_main_np() == 0) {} \
4639N/A#define AWT_ASSERT_NOT_APPKIT_THREAD \
4639N/A while (pthread_main_np() != 0) {} \
4639N/A#define AWT_ASSERT_APPKIT_THREAD do {} while (0)
4639N/A#define AWT_ASSERT_NOT_APPKIT_THREAD do {} while (0)
4639N/A// This tracks if we are current inside of a performOnMainThread that is both waiting and in the AWTRunLoopMode
4639N/A+ (void)performOnMainThread:(SEL)aSelector onObject:(id)target withObject:(id)arg waitUntilDone:(BOOL)wait awtMode:(BOOL)inAWT;
6055N/A+ (void)performOnMainThread:(SEL)aSelector on:(id)target withObject:(id)arg waitUntilDone:(BOOL)wait;