Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
8db67d62
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
8db67d62
编写于
8月 26, 2017
作者:
S
serb
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7124271: [macosx] RealSync test failure
Reviewed-by: alexsch, azvegint
上级
1c23b2b0
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
36 addition
and
19 deletion
+36
-19
src/macosx/native/sun/awt/LWCToolkit.m
src/macosx/native/sun/awt/LWCToolkit.m
+18
-8
src/macosx/native/sun/osxapp/NSApplicationAWT.h
src/macosx/native/sun/osxapp/NSApplicationAWT.h
+3
-3
src/macosx/native/sun/osxapp/NSApplicationAWT.m
src/macosx/native/sun/osxapp/NSApplicationAWT.m
+15
-8
未找到文件。
src/macosx/native/sun/awt/LWCToolkit.m
浏览文件 @
8db67d62
...
...
@@ -131,13 +131,23 @@ static long eventCount;
JNIEXPORT
jboolean
JNICALL
Java_sun_lwawt_macosx_LWCToolkit_nativeSyncQueue
(
JNIEnv
*
env
,
jobject
self
,
jlong
timeout
)
{
int
currentEventNum
=
[
AWTToolkit
getEventCount
];
long
currentEventNum
=
[
AWTToolkit
getEventCount
];
NSApplication
*
sharedApp
=
[
NSApplication
sharedApplication
];
if
([
sharedApp
isKindOfClass
:[
NSApplicationAWT
class
]])
{
NSApplicationAWT
*
theApp
=
(
NSApplicationAWT
*
)
sharedApp
;
[
theApp
postDummyEvent
];
[
theApp
waitForDummyEvent
:
timeout
];
// We use two different API to post events to the application,
// - [NSApplication postEvent]
// - CGEventPost(), see CRobot.m
// It was found that if we post an event via CGEventPost in robot and
// immediately after this we will post the second event via
// [NSApp postEvent] then sometimes the second event will be handled
// first. The opposite isn't proved, but we use both here to be safer.
[
theApp
postDummyEvent
:
false
];
[
theApp
waitForDummyEvent
:
timeout
/
2
.
0
];
[
theApp
postDummyEvent
:
true
];
[
theApp
waitForDummyEvent
:
timeout
/
2
.
0
];
}
else
{
// could happen if we are embedded inside SWT application,
// in this case just spin a single empty block through
...
...
src/macosx/native/sun/osxapp/NSApplicationAWT.h
浏览文件 @
8db67d62
/*
* Copyright (c) 2011, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 201
5
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -36,9 +36,9 @@
-
(
void
)
finishLaunching
;
-
(
void
)
registerWithProcessManager
;
-
(
void
)
setDockIconWithEnv
:(
JNIEnv
*
)
env
;
-
(
void
)
postDummyEvent
;
-
(
void
)
postDummyEvent
:(
bool
)
useCocoa
;
-
(
void
)
postRunnableEvent
:(
void
(
^
)())
block
;
-
(
void
)
waitForDummyEvent
:(
long
long
)
timeout
;
-
(
void
)
waitForDummyEvent
:(
double
)
timeout
;
+
(
void
)
runAWTLoopWithApp
:(
NSApplication
*
)
app
;
...
...
src/macosx/native/sun/osxapp/NSApplicationAWT.m
浏览文件 @
8db67d62
...
...
@@ -377,9 +377,7 @@ AWT_ASSERT_APPKIT_THREAD;
[
pool
drain
];
}
-
(
void
)
postDummyEvent
{
-
(
void
)
postDummyEvent
:(
bool
)
useCocoa
{
seenDummyEventLock
=
[[
NSConditionLock
alloc
]
initWithCondition
:
NO
];
dummyEventTimestamp
=
[
NSProcessInfo
processInfo
].
systemUptime
;
...
...
@@ -393,19 +391,28 @@ AWT_ASSERT_APPKIT_THREAD;
subtype:
0
data1:
0
data2:
0
];
[
NSApp
postEvent
:
event
atStart
:
NO
];
if
(
useCocoa
)
{
[
NSApp
postEvent
:
event
atStart
:
NO
];
}
else
{
ProcessSerialNumber
psn
;
GetCurrentProcess
(
&
psn
);
CGEventPostToPSN
(
&
psn
,
[
event
CGEvent
]);
}
[
pool
drain
];
}
-
(
void
)
waitForDummyEvent
:(
long
long
)
timeout
{
-
(
void
)
waitForDummyEvent
:(
double
)
timeout
{
bool
unlock
=
true
;
if
(
timeout
>=
0
)
{
double
sec
=
((
double
)
timeout
)
/
1000
;
[
seenDummyEventLock
lockWhenCondition
:
YES
double
sec
=
timeout
/
1000
;
unlock
=
[
seenDummyEventLock
lockWhenCondition
:
YES
beforeDate:
[
NSDate
dateWithTimeIntervalSinceNow
:
sec
]];
}
else
{
[
seenDummyEventLock
lockWhenCondition
:
YES
];
}
if
(
unlock
)
{
[
seenDummyEventLock
unlock
];
}
[
seenDummyEventLock
release
];
seenDummyEventLock
=
nil
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录