aboutsummaryrefslogtreecommitdiffstats
path: root/src/nativewindow
diff options
context:
space:
mode:
Diffstat (limited to 'src/nativewindow')
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java b/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java
index ca303e6bc..cd558c05d 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java
@@ -35,7 +35,11 @@ public class OSXUtil {
}
public static void RunOnMainThread(boolean waitUntilDone, Runnable runnable) {
- RunOnMainThread0(waitUntilDone, runnable);
+ if(IsMainThread0()) {
+ runnable.run(); // don't leave the JVM
+ } else {
+ RunOnMainThread0(waitUntilDone, runnable);
+ }
}
public static boolean IsMainThread() {