Mercurial > hg > openjdk > jdk7 > jdk
changeset 3325:d36ad8686f6d
6968933: Clip loop() deadlock in DirectAudioDevice$DirectClip.run
Reviewed-by: amenkov
author | kevinw |
---|---|
date | Tue, 21 Dec 2010 11:32:34 +0000 |
parents | d2a0e795c1c2 |
children | 9deace8396f9 |
files | src/share/classes/com/sun/media/sound/DirectAudioDevice.java |
diffstat | 1 files changed, 5 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/share/classes/com/sun/media/sound/DirectAudioDevice.java Tue Dec 21 17:35:47 2010 +0800 +++ b/src/share/classes/com/sun/media/sound/DirectAudioDevice.java Tue Dec 21 11:32:34 2010 +0000 @@ -1393,8 +1393,11 @@ public void run() { if (Printer.trace) Printer.trace(">>> DirectClip: run() threadID="+Thread.currentThread().getId()); while (thread != null) { - if (!doIO) { - synchronized(lock) { + // doIO is volatile, but we could check it, then get + // pre-empted while another thread changes doIO and notifies, + // before we wait (so we sleep in wait forever). + synchronized(lock) { + if (!doIO) { try { lock.wait(); } catch(InterruptedException ie) {}