提交 4f3b2982 编写于 作者: M mcherkas

8065709: Deadlock in awt/logging apparently introduced by 8019623

Reviewed-by: ant, serb
上级 76382397
...@@ -182,7 +182,14 @@ public class EventQueue { ...@@ -182,7 +182,14 @@ public class EventQueue {
private FwDispatcher fwDispatcher; private FwDispatcher fwDispatcher;
private static final PlatformLogger eventLog = PlatformLogger.getLogger("java.awt.event.EventQueue"); private static volatile PlatformLogger eventLog;
private static final PlatformLogger getEventLog() {
if(eventLog == null) {
eventLog = PlatformLogger.getLogger("java.awt.event.EventQueue");
}
return eventLog;
}
static { static {
AWTAccessor.setEventQueueAccessor( AWTAccessor.setEventQueueAccessor(
...@@ -759,8 +766,8 @@ public class EventQueue { ...@@ -759,8 +766,8 @@ public class EventQueue {
dispatchThread.stopDispatching(); dispatchThread.stopDispatching();
} }
} else { } else {
if (eventLog.isLoggable(PlatformLogger.Level.FINE)) { if (getEventLog().isLoggable(PlatformLogger.Level.FINE)) {
eventLog.fine("Unable to dispatch event: " + event); getEventLog().fine("Unable to dispatch event: " + event);
} }
} }
} }
...@@ -857,8 +864,8 @@ public class EventQueue { ...@@ -857,8 +864,8 @@ public class EventQueue {
* @since 1.2 * @since 1.2
*/ */
public void push(EventQueue newEventQueue) { public void push(EventQueue newEventQueue) {
if (eventLog.isLoggable(PlatformLogger.Level.FINE)) { if (getEventLog().isLoggable(PlatformLogger.Level.FINE)) {
eventLog.fine("EventQueue.push(" + newEventQueue + ")"); getEventLog().fine("EventQueue.push(" + newEventQueue + ")");
} }
pushPopLock.lock(); pushPopLock.lock();
...@@ -883,8 +890,8 @@ public class EventQueue { ...@@ -883,8 +890,8 @@ public class EventQueue {
// Use getNextEventPrivate() as it doesn't call flushPendingEvents() // Use getNextEventPrivate() as it doesn't call flushPendingEvents()
newEventQueue.postEventPrivate(topQueue.getNextEventPrivate()); newEventQueue.postEventPrivate(topQueue.getNextEventPrivate());
} catch (InterruptedException ie) { } catch (InterruptedException ie) {
if (eventLog.isLoggable(PlatformLogger.Level.FINE)) { if (getEventLog().isLoggable(PlatformLogger.Level.FINE)) {
eventLog.fine("Interrupted push", ie); getEventLog().fine("Interrupted push", ie);
} }
} }
} }
...@@ -922,8 +929,8 @@ public class EventQueue { ...@@ -922,8 +929,8 @@ public class EventQueue {
* @since 1.2 * @since 1.2
*/ */
protected void pop() throws EmptyStackException { protected void pop() throws EmptyStackException {
if (eventLog.isLoggable(PlatformLogger.Level.FINE)) { if (getEventLog().isLoggable(PlatformLogger.Level.FINE)) {
eventLog.fine("EventQueue.pop(" + this + ")"); getEventLog().fine("EventQueue.pop(" + this + ")");
} }
pushPopLock.lock(); pushPopLock.lock();
...@@ -945,8 +952,8 @@ public class EventQueue { ...@@ -945,8 +952,8 @@ public class EventQueue {
try { try {
prevQueue.postEventPrivate(topQueue.getNextEventPrivate()); prevQueue.postEventPrivate(topQueue.getNextEventPrivate());
} catch (InterruptedException ie) { } catch (InterruptedException ie) {
if (eventLog.isLoggable(PlatformLogger.Level.FINE)) { if (getEventLog().isLoggable(PlatformLogger.Level.FINE)) {
eventLog.fine("Interrupted pop", ie); getEventLog().fine("Interrupted pop", ie);
} }
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册