changeset 2566:dfdf72956eee

Synchronize access to shared variable The variable writeInterrupted is accessed everywhere while holding a lock on 'this' object, except in one location. Fix that. 2012-06-28 Omair Majid <omajid@redhat.com> * pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java (write): Synchronize access to writeInterrupted flag.
author Omair Majid <omajid@redhat.com>
date Thu, 28 Jun 2012 19:45:23 -0400
parents 3b4d1d6a3b63
children 748c609a6a14
files ChangeLog pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java
diffstat 2 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Jun 29 00:02:21 2012 +0100
+++ b/ChangeLog	Thu Jun 28 19:45:23 2012 -0400
@@ -1,3 +1,8 @@
+2012-06-28  Omair Majid  <omajid@redhat.com>
+
+	* pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java
+	(write): Synchronize access to writeInterrupted flag.
+
 2012-06-28  Andrew John Hughes  <gnu_andrew@member.fsf.org>
 
 	* Makefile.am:
--- a/pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java	Fri Jun 29 00:02:21 2012 +0100
+++ b/pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java	Thu Jun 28 19:45:23 2012 -0400
@@ -179,8 +179,10 @@
             synchronized (eventLoop.threadLock) {
 
                 do {
-                    if (writeInterrupted) {
-                        return sizeWritten;
+                    synchronized (this) {
+                        if (writeInterrupted) {
+                            return sizeWritten;
+                        }
                     }
 
                     if (availableSize == -1) {