From 9532027f0e6d15310d44f96124469b2defb59d01 Mon Sep 17 00:00:00 2001 From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com> Date: Fri, 22 Sep 2017 18:55:05 +0000 Subject: [PATCH] Changed a couple effect list methods to synchronized. --- .../l2jmobius/gameserver/model/CharEffectList.java | 12 +++--------- .../l2jmobius/gameserver/model/CharEffectList.java | 12 +++--------- .../l2jmobius/gameserver/model/CharEffectList.java | 12 +++--------- .../l2jmobius/gameserver/model/CharEffectList.java | 12 +++--------- 4 files changed, 12 insertions(+), 36 deletions(-) diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/CharEffectList.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/CharEffectList.java index 67d786e931..de027352eb 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/CharEffectList.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/CharEffectList.java @@ -666,7 +666,7 @@ public final class CharEffectList * @param info * @param removed */ - private void removeActive(BuffInfo info, boolean removed) + private synchronized void removeActive(BuffInfo info, boolean removed) { if (_actives != null) { @@ -741,7 +741,7 @@ public final class CharEffectList updateEffectList(true); } - private void addActive(BuffInfo info) + private synchronized void addActive(BuffInfo info) { final Skill skill = info.getSkill(); @@ -796,13 +796,7 @@ public final class CharEffectList // Initialize if (_actives == null) { - synchronized (this) - { - if (_actives == null) - { - _actives = new ConcurrentLinkedQueue<>(); - } - } + _actives = new ConcurrentLinkedQueue<>(); } // Manage effect stacking. diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/CharEffectList.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/CharEffectList.java index 67d786e931..de027352eb 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/CharEffectList.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/CharEffectList.java @@ -666,7 +666,7 @@ public final class CharEffectList * @param info * @param removed */ - private void removeActive(BuffInfo info, boolean removed) + private synchronized void removeActive(BuffInfo info, boolean removed) { if (_actives != null) { @@ -741,7 +741,7 @@ public final class CharEffectList updateEffectList(true); } - private void addActive(BuffInfo info) + private synchronized void addActive(BuffInfo info) { final Skill skill = info.getSkill(); @@ -796,13 +796,7 @@ public final class CharEffectList // Initialize if (_actives == null) { - synchronized (this) - { - if (_actives == null) - { - _actives = new ConcurrentLinkedQueue<>(); - } - } + _actives = new ConcurrentLinkedQueue<>(); } // Manage effect stacking. diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/CharEffectList.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/CharEffectList.java index 67d786e931..de027352eb 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/CharEffectList.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/CharEffectList.java @@ -666,7 +666,7 @@ public final class CharEffectList * @param info * @param removed */ - private void removeActive(BuffInfo info, boolean removed) + private synchronized void removeActive(BuffInfo info, boolean removed) { if (_actives != null) { @@ -741,7 +741,7 @@ public final class CharEffectList updateEffectList(true); } - private void addActive(BuffInfo info) + private synchronized void addActive(BuffInfo info) { final Skill skill = info.getSkill(); @@ -796,13 +796,7 @@ public final class CharEffectList // Initialize if (_actives == null) { - synchronized (this) - { - if (_actives == null) - { - _actives = new ConcurrentLinkedQueue<>(); - } - } + _actives = new ConcurrentLinkedQueue<>(); } // Manage effect stacking. diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/CharEffectList.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/CharEffectList.java index 67d786e931..de027352eb 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/CharEffectList.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/CharEffectList.java @@ -666,7 +666,7 @@ public final class CharEffectList * @param info * @param removed */ - private void removeActive(BuffInfo info, boolean removed) + private synchronized void removeActive(BuffInfo info, boolean removed) { if (_actives != null) { @@ -741,7 +741,7 @@ public final class CharEffectList updateEffectList(true); } - private void addActive(BuffInfo info) + private synchronized void addActive(BuffInfo info) { final Skill skill = info.getSkill(); @@ -796,13 +796,7 @@ public final class CharEffectList // Initialize if (_actives == null) { - synchronized (this) - { - if (_actives == null) - { - _actives = new ConcurrentLinkedQueue<>(); - } - } + _actives = new ConcurrentLinkedQueue<>(); } // Manage effect stacking.