From 1e8dea8eba314e81d6a676bcf34608c5d380e110 Mon Sep 17 00:00:00 2001 From: "PSp..om" Date: Sun, 17 Jul 2011 21:55:29 +0000 Subject: [PATCH] Made the methods called from the audio thread final because no good can come from overriding them. Also made those variables volatile so that other threads are guaranteed to see the right values. git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7874 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- engine/src/core/com/jme3/audio/AudioNode.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/engine/src/core/com/jme3/audio/AudioNode.java b/engine/src/core/com/jme3/audio/AudioNode.java index d374e4473..b0fefd8d5 100644 --- a/engine/src/core/com/jme3/audio/AudioNode.java +++ b/engine/src/core/com/jme3/audio/AudioNode.java @@ -66,8 +66,8 @@ public class AudioNode extends Node { protected Filter dryFilter; protected AudioKey key; protected transient AudioData data = null; - protected transient Status status = Status.Stopped; - protected transient int channel = -1; + protected transient volatile Status status = Status.Stopped; + protected transient volatile int channel = -1; protected Vector3f velocity = new Vector3f(); protected boolean reverbEnabled = true; protected float maxDistance = 200; // 200 meters @@ -262,7 +262,7 @@ public class AudioNode extends Node { /** * Do not use. */ - public void setChannel(int channel) { + public final void setChannel(int channel) { if (status != Status.Stopped) { throw new IllegalStateException("Can only set source id when stopped"); } @@ -341,7 +341,7 @@ public class AudioNode extends Node { /** * Do not use. */ - public void setStatus(Status status) { + public final void setStatus(Status status) { this.status = status; }