7148289: [macosx] Deadlock in sun.lwawt.macosx.CWrapper$NSScreen.visibleFrame
Reviewed-by: leonidr
This commit is contained in:
parent
e6869edf38
commit
e3ab8ba856
@ -27,9 +27,9 @@ package sun.lwawt.macosx;
|
|||||||
|
|
||||||
import sun.awt.datatransfer.ToolkitThreadBlockedHandler;
|
import sun.awt.datatransfer.ToolkitThreadBlockedHandler;
|
||||||
|
|
||||||
// TODO:BG this class is really a NOOP right now, but should be filled in if needed.
|
|
||||||
|
|
||||||
final class CToolkitThreadBlockedHandler implements ToolkitThreadBlockedHandler {
|
final class CToolkitThreadBlockedHandler implements ToolkitThreadBlockedHandler {
|
||||||
|
private final LWCToolkit toolkit = (LWCToolkit)java.awt.Toolkit.getDefaultToolkit();
|
||||||
|
|
||||||
public void lock() {
|
public void lock() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -41,9 +41,10 @@ final class CToolkitThreadBlockedHandler implements ToolkitThreadBlockedHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void enter() {
|
public void enter() {
|
||||||
|
toolkit.startNativeNestedEventLoop();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void exit() {
|
public void exit() {
|
||||||
|
toolkit.stopNativeNestedEventLoop();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -63,6 +63,10 @@ public class LWCToolkit extends LWToolkit {
|
|||||||
|
|
||||||
private static native void initIDs();
|
private static native void initIDs();
|
||||||
|
|
||||||
|
static native void startNativeNestedEventLoop();
|
||||||
|
|
||||||
|
static native void stopNativeNestedEventLoop();
|
||||||
|
|
||||||
private static CInputMethodDescriptor sInputMethodDescriptor;
|
private static CInputMethodDescriptor sInputMethodDescriptor;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
|
@ -42,6 +42,7 @@ jint* gButtonDownMasks;
|
|||||||
@implementation AWTToolkit
|
@implementation AWTToolkit
|
||||||
|
|
||||||
static long eventCount;
|
static long eventCount;
|
||||||
|
static bool shouldKeepRunningNestedLoop = NO;
|
||||||
|
|
||||||
+ (long) getEventCount{
|
+ (long) getEventCount{
|
||||||
return eventCount;
|
return eventCount;
|
||||||
@ -456,3 +457,36 @@ Java_sun_font_FontManager_populateFontFileNameMap
|
|||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Class: sun_lwawt_macosx_LWCToolkit
|
||||||
|
* Method: startNativeNestedEventLoop
|
||||||
|
* Signature: ()V
|
||||||
|
*/
|
||||||
|
JNIEXPORT void JNICALL Java_sun_lwawt_macosx_LWCToolkit_startNativeNestedEventLoop
|
||||||
|
(JNIEnv *env, jclass cls)
|
||||||
|
{
|
||||||
|
if(!shouldKeepRunningNestedLoop) {
|
||||||
|
NSRunLoop *theRL = [NSRunLoop currentRunLoop];
|
||||||
|
NSApplication * app = [NSApplication sharedApplication];
|
||||||
|
shouldKeepRunningNestedLoop = YES;
|
||||||
|
while (shouldKeepRunningNestedLoop && [theRL runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]])
|
||||||
|
{
|
||||||
|
NSEvent * event = [app nextEventMatchingMask: 0xFFFFFFFF untilDate:nil inMode:NSDefaultRunLoopMode dequeue:YES];
|
||||||
|
if (event != nil) {
|
||||||
|
[app sendEvent: event];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Class: sun_lwawt_macosx_LWCToolkit
|
||||||
|
* Method: stopNativeNestedEventLoop
|
||||||
|
* Signature: ()V
|
||||||
|
*/
|
||||||
|
JNIEXPORT void JNICALL Java_sun_lwawt_macosx_LWCToolkit_stopNativeNestedEventLoop
|
||||||
|
(JNIEnv *env, jclass cls)
|
||||||
|
{
|
||||||
|
shouldKeepRunningNestedLoop = NO;
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user