/hg/icedtea7: Synchronize access to shared variable

omajid at icedtea.classpath.org omajid at icedtea.classpath.org
Thu Jun 28 16:48:09 PDT 2012


changeset dfdf72956eee in /hg/icedtea7
details: http://icedtea.classpath.org/hg/icedtea7?cmd=changeset;node=dfdf72956eee
author: Omair Majid <omajid at redhat.com>
date: Thu Jun 28 19:45:23 2012 -0400

	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 at redhat.com>

	    * pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java
	    (write): Synchronize access to writeInterrupted flag.


diffstat:

 ChangeLog                                                                          |  5 +++++
 pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java |  6 ++++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r 3b4d1d6a3b63 -r dfdf72956eee ChangeLog
--- 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 at 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 at member.fsf.org>
 
 	* Makefile.am:
diff -r 3b4d1d6a3b63 -r dfdf72956eee pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioSourceDataLine.java
--- 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) {



More information about the distro-pkg-dev mailing list