diff --git a/src/share/classes/com/sun/media/sound/DirectAudioDevice.java b/src/share/classes/com/sun/media/sound/DirectAudioDevice.java index 127e7f35ce332e6134346529055698636e6a0f68..57c80856f0311891f6e1894c54283a3984c0da61 100644 --- a/src/share/classes/com/sun/media/sound/DirectAudioDevice.java +++ b/src/share/classes/com/sun/media/sound/DirectAudioDevice.java @@ -1393,8 +1393,11 @@ class DirectAudioDevice extends AbstractMixer { 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) {}