fix thread contention for audio tweens
parent
0d441ae07a
commit
0781a99273
|
@ -194,6 +194,8 @@ namespace MoonWorks.Audio
|
||||||
float end,
|
float end,
|
||||||
float duration
|
float duration
|
||||||
) {
|
) {
|
||||||
|
lock (StateLock)
|
||||||
|
{
|
||||||
var tween = AudioTweenPool.Obtain();
|
var tween = AudioTweenPool.Obtain();
|
||||||
tween.SoundInstanceReference = new WeakReference<SoundInstance>(soundInstance);
|
tween.SoundInstanceReference = new WeakReference<SoundInstance>(soundInstance);
|
||||||
tween.Property = property;
|
tween.Property = property;
|
||||||
|
@ -203,8 +205,6 @@ namespace MoonWorks.Audio
|
||||||
tween.Duration = duration;
|
tween.Duration = duration;
|
||||||
tween.Time = 0;
|
tween.Time = 0;
|
||||||
|
|
||||||
lock (StateLock)
|
|
||||||
{
|
|
||||||
AudioTweens.Add(tween);
|
AudioTweens.Add(tween);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue