--- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/LWCToolkit.m Mon Jun 29 01:27:08 2015 +0300
+++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/LWCToolkit.m Mon Jun 29 13:47:28 2015 +0300
@@ -376,7 +376,7 @@
if ([sharedApp isKindOfClass:[NSApplicationAWT class]]) {
NSApplicationAWT* theApp = (NSApplicationAWT*)sharedApp;
[theApp postDummyEvent];
- [theApp waitForDummyEvent];
+ [theApp waitForDummyEvent:timeout];
} else {
// could happen if we are embedded inside SWT application,
// in this case just spin a single empty block through
--- a/jdk/src/java.desktop/macosx/native/libosxapp/NSApplicationAWT.h Mon Jun 29 01:27:08 2015 +0300
+++ b/jdk/src/java.desktop/macosx/native/libosxapp/NSApplicationAWT.h Mon Jun 29 13:47:28 2015 +0300
@@ -38,7 +38,7 @@
- (void) setDockIconWithEnv:(JNIEnv *)env;
- (void) postDummyEvent;
- (void) postRunnableEvent:(void (^)())block;
-- (void) waitForDummyEvent;
+- (void) waitForDummyEvent:(long long) timeout;
+ (void) runAWTLoopWithApp:(NSApplication*)app;
--- a/jdk/src/java.desktop/macosx/native/libosxapp/NSApplicationAWT.m Mon Jun 29 01:27:08 2015 +0300
+++ b/jdk/src/java.desktop/macosx/native/libosxapp/NSApplicationAWT.m Mon Jun 29 13:47:28 2015 +0300
@@ -398,8 +398,14 @@
[pool drain];
}
-- (void)waitForDummyEvent {
- [seenDummyEventLock lockWhenCondition:YES];
+- (void)waitForDummyEvent:(long long) timeout {
+ if (timeout >= 0) {
+ double sec = ((double) timeout)/1000;
+ [seenDummyEventLock lockWhenCondition:YES
+ beforeDate:[NSDate dateWithTimeIntervalSinceNow:sec]];
+ } else {
+ [seenDummyEventLock lockWhenCondition:YES];
+ }
[seenDummyEventLock unlock];
[seenDummyEventLock release];