122
123 #define AWT_ASSERT_APPKIT_THREAD do {} while (0)
124 #define AWT_ASSERT_NOT_APPKIT_THREAD do {} while (0)
125 #define AWT_ASSERT_ANY_THREAD
126
127 #endif /* AWT_THREAD_ASSERTS */
128 // --------------------------------------------------------------------------
129
130 // This tracks if we are current inside of a performOnMainThread that is both waiting and in the AWTRunLoopMode
131 extern BOOL sInPerformFromJava;
132
133 // This is an empty Obj-C object just so that -performSelectorOnMainThread
134 // can be used, and to use the Obj-C +initialize feature.
135 __attribute__((visibility("default")))
136 @interface ThreadUtilities : NSObject { }
137
138 + (JNIEnv*)getJNIEnv;
139 + (JNIEnv*)getJNIEnvUncached;
140
141 + (void)performOnMainThread:(SEL)aSelector onObject:(id)target withObject:(id)arg waitUntilDone:(BOOL)wait awtMode:(BOOL)inAWT;
142
143 @end
144
145 void OSXAPP_SetJavaVM(JavaVM *vm);
146
147 #endif /* __THREADUTILITIES_H */
|
122
123 #define AWT_ASSERT_APPKIT_THREAD do {} while (0)
124 #define AWT_ASSERT_NOT_APPKIT_THREAD do {} while (0)
125 #define AWT_ASSERT_ANY_THREAD
126
127 #endif /* AWT_THREAD_ASSERTS */
128 // --------------------------------------------------------------------------
129
130 // This tracks if we are current inside of a performOnMainThread that is both waiting and in the AWTRunLoopMode
131 extern BOOL sInPerformFromJava;
132
133 // This is an empty Obj-C object just so that -performSelectorOnMainThread
134 // can be used, and to use the Obj-C +initialize feature.
135 __attribute__((visibility("default")))
136 @interface ThreadUtilities : NSObject { }
137
138 + (JNIEnv*)getJNIEnv;
139 + (JNIEnv*)getJNIEnvUncached;
140
141 + (void)performOnMainThread:(SEL)aSelector onObject:(id)target withObject:(id)arg waitUntilDone:(BOOL)wait awtMode:(BOOL)inAWT;
142 + (void)performOnMainThreadWaiting:(BOOL)wait block:(void (^)())block;
143 @end
144
145 void OSXAPP_SetJavaVM(JavaVM *vm);
146
147 #endif /* __THREADUTILITIES_H */
|