Просмотр исходного кода

BETA: Improvements for `ThreadPoolManager`.
* Removed all deprecated methods.
* Added Javadocs.
* Added new schedule methods with `TimeUnit` parameter to make code more readable and require less external calculations since they will be done by `TimeUnit`.
* Renamed `ThreadPoolManager#executeTask` to `ThreadPoolManager#executeGeneral`.
* Removed `ThreadPoolManager#executeCommunityPacket` and replaced it with `ThreadPoolManager#executePacket` since it was using same thread pool.

Reviewed by: !UnAfraid

Nos 11 лет назад
Родитель
Сommit
180cd667ad

+ 148 - 68
L2J_Server_BETA/java/com/l2jserver/gameserver/ThreadPoolManager.java

@@ -21,7 +21,6 @@ package com.l2jserver.gameserver;
 import java.lang.Thread.UncaughtExceptionHandler;
 import java.util.concurrent.LinkedBlockingQueue;
 import java.util.concurrent.RejectedExecutionException;
-import java.util.concurrent.RunnableScheduledFuture;
 import java.util.concurrent.ScheduledFuture;
 import java.util.concurrent.ScheduledThreadPoolExecutor;
 import java.util.concurrent.ThreadFactory;
@@ -40,7 +39,7 @@ import com.l2jserver.util.StringUtil;
 
 /**
  * <p>
- * This class is made to handle all the ThreadPools used in L2j.
+ * This class is made to handle all the ThreadPools used in L2J.
  * </p>
  * <p>
  * Scheduled Tasks can either be sent to a {@link #_generalScheduledThreadPool "general"} or {@link #_effectsScheduledThreadPool "effects"} {@link ScheduledThreadPoolExecutor ScheduledThreadPool}: The "effects" one is used for every effects (skills, hp/mp regen ...) while the "general" one is used
@@ -50,15 +49,15 @@ import com.l2jserver.util.StringUtil;
  * <p>
  * Tasks can be sent to {@link ScheduledThreadPoolExecutor ScheduledThreadPool} either with:
  * <ul>
- * <li>{@link #scheduleEffect(Runnable, long)} : for effects Tasks that needs to be executed only once.</li>
- * <li>{@link #scheduleGeneral(Runnable, long)} : for scheduled Tasks that needs to be executed once.</li>
- * <li>{@link #scheduleAi(Runnable, long)} : for AI Tasks that needs to be executed once</li>
+ * <li>{@link #scheduleEffect(Runnable, long, TimeUnit)} and {@link #scheduleEffect(Runnable, long)} : for effects Tasks that needs to be executed only once.</li>
+ * <li>{@link #scheduleGeneral(Runnable, long, TimeUnit)} and {@link #scheduleGeneral(Runnable, long)} : for scheduled Tasks that needs to be executed once.</li>
+ * <li>{@link #scheduleAi(Runnable, long, TimeUnit)} and {@link #scheduleAi(Runnable, long)} : for AI Tasks that needs to be executed once</li>
  * </ul>
  * or
  * <ul>
- * <li>{@link #scheduleEffectAtFixedRate(Runnable, long, long)} : for effects Tasks that needs to be executed periodicaly.</li>
- * <li>{@link #scheduleGeneralAtFixedRate(Runnable, long, long)} : for scheduled Tasks that needs to be executed periodicaly.</li>
- * <li>{@link #scheduleAiAtFixedRate(Runnable, long, long)} : for AI Tasks that needs to be executed periodicaly</li>
+ * <li>{@link #scheduleEffectAtFixedRate(Runnable, long, long, TimeUnit)} and {@link #scheduleEffectAtFixedRate(Runnable, long, long)} : for effects Tasks that needs to be executed periodicaly.</li>
+ * <li>{@link #scheduleGeneralAtFixedRate(Runnable, long, long, TimeUnit)} and {@link #scheduleGeneralAtFixedRate(Runnable, long, long)} : for scheduled Tasks that needs to be executed periodicaly.</li>
+ * <li>{@link #scheduleAiAtFixedRate(Runnable, long, long, TimeUnit)} and {@link #scheduleAiAtFixedRate(Runnable, long, long)} : for AI Tasks that needs to be executed periodicaly</li>
  * </ul>
  * </p>
  * <p>
@@ -111,9 +110,6 @@ public class ThreadPoolManager
 	private final ThreadPoolExecutor _ioPacketsThreadPool;
 	private final ThreadPoolExecutor _generalThreadPool;
 	
-	/** temp workaround for VM issue */
-	private static final long MAX_DELAY = Long.MAX_VALUE / 1000000 / 2;
-	
 	private boolean _shutdown;
 	
 	public static ThreadPoolManager getInstance()
@@ -129,29 +125,22 @@ public class ThreadPoolManager
 		_generalPacketsThreadPool = new ThreadPoolExecutor(Config.GENERAL_PACKET_THREAD_CORE_SIZE, Config.GENERAL_PACKET_THREAD_CORE_SIZE + 2, 15L, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(), new PriorityThreadFactory("Normal Packet Pool", Thread.NORM_PRIORITY + 1));
 		_generalThreadPool = new ThreadPoolExecutor(Config.GENERAL_THREAD_CORE_SIZE, Config.GENERAL_THREAD_CORE_SIZE + 2, 5L, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(), new PriorityThreadFactory("General Pool", Thread.NORM_PRIORITY));
 		_aiScheduledThreadPool = new ScheduledThreadPoolExecutor(Config.AI_MAX_THREAD, new PriorityThreadFactory("AISTPool", Thread.NORM_PRIORITY));
-		// Initial 10 minutes, delay 5 minutes.
-		scheduleGeneralAtFixedRate(new PurgeTask(), 600000L, 300000L);
-	}
-	
-	public static long validateDelay(long delay)
-	{
-		if (delay < 0)
-		{
-			delay = 0;
-		}
-		else if (delay > MAX_DELAY)
-		{
-			delay = MAX_DELAY;
-		}
-		return delay;
+		
+		scheduleGeneralAtFixedRate(new PurgeTask(), 10, 5, TimeUnit.MINUTES);
 	}
 	
-	public ScheduledFuture<?> scheduleEffect(Runnable r, long delay)
+	/**
+	 * Schedules an effect task to be executed after the given delay.
+	 * @param task the task to execute
+	 * @param delay the delay in the given time unit
+	 * @param unit the time unit of the delay parameter
+	 * @return a ScheduledFuture representing pending completion of the task, and whose get() method will throw an exception upon cancellation
+	 */
+	public ScheduledFuture<?> scheduleEffect(Runnable task, long delay, TimeUnit unit)
 	{
 		try
 		{
-			delay = ThreadPoolManager.validateDelay(delay);
-			return _effectsScheduledThreadPool.schedule(new RunnableWrapper(r), delay, TimeUnit.MILLISECONDS);
+			return _effectsScheduledThreadPool.schedule(new RunnableWrapper(task), delay, unit);
 		}
 		catch (RejectedExecutionException e)
 		{
@@ -160,19 +149,29 @@ public class ThreadPoolManager
 	}
 	
 	/**
-	 * Schedule an effect at a fixed rate.
-	 * @param task the runnable task
-	 * @param initialDelay the initial delay in milliseconds
-	 * @param period the period between executions in milliseconds
-	 * @return a runnable scheduled future object
+	 * Schedules an effect task to be executed after the given delay.
+	 * @param task the task to execute
+	 * @param delay the delay in milliseconds
+	 * @return a ScheduledFuture representing pending completion of the task, and whose get() method will throw an exception upon cancellation
 	 */
-	public ScheduledFuture<?> scheduleEffectAtFixedRate(Runnable task, long initialDelay, long period)
+	public ScheduledFuture<?> scheduleEffect(Runnable task, long delay)
+	{
+		return scheduleEffect(task, delay, TimeUnit.MILLISECONDS);
+	}
+	
+	/**
+	 * Schedules an effect task to be executed at fixed rate.
+	 * @param task the task to execute
+	 * @param initialDelay the initial delay in the given time unit
+	 * @param period the period between executions in the given time unit
+	 * @param unit the time unit of the initialDelay and period parameters
+	 * @return a ScheduledFuture representing pending completion of the task, and whose get() method will throw an exception upon cancellation
+	 */
+	public ScheduledFuture<?> scheduleEffectAtFixedRate(Runnable task, long initialDelay, long period, TimeUnit unit)
 	{
 		try
 		{
-			period = ThreadPoolManager.validateDelay(period);
-			initialDelay = ThreadPoolManager.validateDelay(initialDelay);
-			return _effectsScheduledThreadPool.scheduleAtFixedRate(new RunnableWrapper(task), initialDelay, period, TimeUnit.MILLISECONDS);
+			return _effectsScheduledThreadPool.scheduleAtFixedRate(new RunnableWrapper(task), initialDelay, period, unit);
 		}
 		catch (RejectedExecutionException e)
 		{
@@ -180,18 +179,30 @@ public class ThreadPoolManager
 		}
 	}
 	
-	@Deprecated
-	public boolean removeEffect(RunnableScheduledFuture<?> r)
+	/**
+	 * Schedules an effect task to be executed at fixed rate.
+	 * @param task the task to execute
+	 * @param initialDelay the initial delay in milliseconds
+	 * @param period the period between executions in milliseconds
+	 * @return a ScheduledFuture representing pending completion of the task, and whose get() method will throw an exception upon cancellation
+	 */
+	public ScheduledFuture<?> scheduleEffectAtFixedRate(Runnable task, long initialDelay, long period)
 	{
-		return _effectsScheduledThreadPool.remove(r);
+		return scheduleEffectAtFixedRate(task, initialDelay, period, TimeUnit.MILLISECONDS);
 	}
 	
-	public ScheduledFuture<?> scheduleGeneral(Runnable r, long delay)
+	/**
+	 * Schedules a general task to be executed after the given delay.
+	 * @param task the task to execute
+	 * @param delay the delay in the given time unit
+	 * @param unit the time unit of the delay parameter
+	 * @return a ScheduledFuture representing pending completion of the task, and whose get() method will throw an exception upon cancellation
+	 */
+	public ScheduledFuture<?> scheduleGeneral(Runnable task, long delay, TimeUnit unit)
 	{
 		try
 		{
-			delay = ThreadPoolManager.validateDelay(delay);
-			return _generalScheduledThreadPool.schedule(new RunnableWrapper(r), delay, TimeUnit.MILLISECONDS);
+			return _generalScheduledThreadPool.schedule(new RunnableWrapper(task), delay, unit);
 		}
 		catch (RejectedExecutionException e)
 		{
@@ -199,13 +210,30 @@ public class ThreadPoolManager
 		}
 	}
 	
-	public ScheduledFuture<?> scheduleGeneralAtFixedRate(Runnable r, long initial, long delay)
+	/**
+	 * Schedules a general task to be executed after the given delay.
+	 * @param task the task to execute
+	 * @param delay the delay in milliseconds
+	 * @return a ScheduledFuture representing pending completion of the task, and whose get() method will throw an exception upon cancellation
+	 */
+	public ScheduledFuture<?> scheduleGeneral(Runnable task, long delay)
+	{
+		return scheduleGeneral(task, delay, TimeUnit.MILLISECONDS);
+	}
+	
+	/**
+	 * Schedules a general task to be executed at fixed rate.
+	 * @param task the task to execute
+	 * @param initialDelay the initial delay in the given time unit
+	 * @param period the period between executions in the given time unit
+	 * @param unit the time unit of the initialDelay and period parameters
+	 * @return a ScheduledFuture representing pending completion of the task, and whose get() method will throw an exception upon cancellation
+	 */
+	public ScheduledFuture<?> scheduleGeneralAtFixedRate(Runnable task, long initialDelay, long period, TimeUnit unit)
 	{
 		try
 		{
-			delay = ThreadPoolManager.validateDelay(delay);
-			initial = ThreadPoolManager.validateDelay(initial);
-			return _generalScheduledThreadPool.scheduleAtFixedRate(new RunnableWrapper(r), initial, delay, TimeUnit.MILLISECONDS);
+			return _generalScheduledThreadPool.scheduleAtFixedRate(new RunnableWrapper(task), initialDelay, period, unit);
 		}
 		catch (RejectedExecutionException e)
 		{
@@ -213,18 +241,30 @@ public class ThreadPoolManager
 		}
 	}
 	
-	@Deprecated
-	public boolean removeGeneral(RunnableScheduledFuture<?> r)
+	/**
+	 * Schedules a general task to be executed at fixed rate.
+	 * @param task the task to execute
+	 * @param initialDelay the initial delay in milliseconds
+	 * @param period the period between executions in milliseconds
+	 * @return a ScheduledFuture representing pending completion of the task, and whose get() method will throw an exception upon cancellation
+	 */
+	public ScheduledFuture<?> scheduleGeneralAtFixedRate(Runnable task, long initialDelay, long period)
 	{
-		return _generalScheduledThreadPool.remove(r);
+		return scheduleGeneralAtFixedRate(task, initialDelay, period, TimeUnit.MILLISECONDS);
 	}
 	
-	public ScheduledFuture<?> scheduleAi(Runnable r, long delay)
+	/**
+	 * Schedules an AI task to be executed after the given delay.
+	 * @param task the task to execute
+	 * @param delay the delay in the given time unit
+	 * @param unit the time unit of the delay parameter
+	 * @return a ScheduledFuture representing pending completion of the task, and whose get() method will throw an exception upon cancellation
+	 */
+	public ScheduledFuture<?> scheduleAi(Runnable task, long delay, TimeUnit unit)
 	{
 		try
 		{
-			delay = ThreadPoolManager.validateDelay(delay);
-			return _aiScheduledThreadPool.schedule(new RunnableWrapper(r), delay, TimeUnit.MILLISECONDS);
+			return _aiScheduledThreadPool.schedule(new RunnableWrapper(task), delay, unit);
 		}
 		catch (RejectedExecutionException e)
 		{
@@ -232,13 +272,30 @@ public class ThreadPoolManager
 		}
 	}
 	
-	public ScheduledFuture<?> scheduleAiAtFixedRate(Runnable r, long initial, long delay)
+	/**
+	 * Schedules an AI task to be executed after the given delay.
+	 * @param task the task to execute
+	 * @param delay the delay in milliseconds
+	 * @return a ScheduledFuture representing pending completion of the task, and whose get() method will throw an exception upon cancellation
+	 */
+	public ScheduledFuture<?> scheduleAi(Runnable task, long delay)
+	{
+		return scheduleAi(task, delay, TimeUnit.MILLISECONDS);
+	}
+	
+	/**
+	 * Schedules a general task to be executed at fixed rate.
+	 * @param task the task to execute
+	 * @param initialDelay the initial delay in the given time unit
+	 * @param period the period between executions in the given time unit
+	 * @param unit the time unit of the initialDelay and period parameters
+	 * @return a ScheduledFuture representing pending completion of the task, and whose get() method will throw an exception upon cancellation
+	 */
+	public ScheduledFuture<?> scheduleAiAtFixedRate(Runnable task, long initialDelay, long period, TimeUnit unit)
 	{
 		try
 		{
-			delay = ThreadPoolManager.validateDelay(delay);
-			initial = ThreadPoolManager.validateDelay(initial);
-			return _aiScheduledThreadPool.scheduleAtFixedRate(new RunnableWrapper(r), initial, delay, TimeUnit.MILLISECONDS);
+			return _aiScheduledThreadPool.scheduleAtFixedRate(new RunnableWrapper(task), initialDelay, period, unit);
 		}
 		catch (RejectedExecutionException e)
 		{
@@ -246,29 +303,52 @@ public class ThreadPoolManager
 		}
 	}
 	
-	public void executePacket(Runnable pkt)
+	/**
+	 * Schedules a general task to be executed at fixed rate.
+	 * @param task the task to execute
+	 * @param initialDelay the initial delay in milliseconds
+	 * @param period the period between executions in milliseconds
+	 * @return a ScheduledFuture representing pending completion of the task, and whose get() method will throw an exception upon cancellation
+	 */
+	public ScheduledFuture<?> scheduleAiAtFixedRate(Runnable task, long initialDelay, long period)
 	{
-		_generalPacketsThreadPool.execute(pkt);
+		return scheduleAiAtFixedRate(task, initialDelay, period, TimeUnit.MILLISECONDS);
 	}
 	
-	public void executeCommunityPacket(Runnable r)
+	/**
+	 * Executes a packet task sometime in future in another thread.
+	 * @param task the task to execute
+	 */
+	public void executePacket(Runnable task)
 	{
-		_generalPacketsThreadPool.execute(r);
+		_generalPacketsThreadPool.execute(task);
 	}
 	
-	public void executeIOPacket(Runnable pkt)
+	/**
+	 * Executes an IO packet task sometime in future in another thread.
+	 * @param task the task to execute
+	 */
+	public void executeIOPacket(Runnable task)
 	{
-		_ioPacketsThreadPool.execute(pkt);
+		_ioPacketsThreadPool.execute(task);
 	}
 	
-	public void executeTask(Runnable r)
+	/**
+	 * Executes a general task sometime in future in another thread.
+	 * @param task the task to execute
+	 */
+	public void executeGeneral(Runnable task)
 	{
-		_generalThreadPool.execute(r);
+		_generalThreadPool.execute(new RunnableWrapper(task));
 	}
 	
-	public void executeAi(Runnable r)
+	/**
+	 * Executes an AI task sometime in future in another thread.
+	 * @param task the task to execute
+	 */
+	public void executeAi(Runnable task)
 	{
-		_aiScheduledThreadPool.execute(new RunnableWrapper(r));
+		_aiScheduledThreadPool.execute(new RunnableWrapper(task));
 	}
 	
 	public String[] getStats()

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/ai/L2DoorAI.java

@@ -91,7 +91,7 @@ public class L2DoorAI extends L2CharacterAI
 	protected void onEvtAttacked(L2Character attacker)
 	{
 		L2DoorInstance me = (L2DoorInstance) _actor;
-		ThreadPoolManager.getInstance().executeTask(new onEventAttackedDoorTask(me, attacker));
+		ThreadPoolManager.getInstance().executeGeneral(new onEventAttackedDoorTask(me, attacker));
 	}
 	
 	@Override

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/HandysBlockCheckerManager.java

@@ -88,7 +88,7 @@ public final class HandysBlockCheckerManager
 			{
 				holder.checkAndShuffle();
 			}
-			ThreadPoolManager.getInstance().executeTask(holder.getEvent().new StartEvent());
+			ThreadPoolManager.getInstance().executeGeneral(holder.getEvent().new StartEvent());
 		}
 		else
 		{

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/L2Character.java

@@ -5929,7 +5929,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
 				
 				// DON'T USE : Recursive call to useMagic() method
 				// currPlayer.useMagic(queuedSkill.getSkill(), queuedSkill.isCtrlPressed(), queuedSkill.isShiftPressed());
-				ThreadPoolManager.getInstance().executeTask(new QueuedMagicUseTask(currPlayer, queuedSkill.getSkill(), queuedSkill.isCtrlPressed(), queuedSkill.isShiftPressed()));
+				ThreadPoolManager.getInstance().executeGeneral(new QueuedMagicUseTask(currPlayer, queuedSkill.getSkill(), queuedSkill.isCtrlPressed(), queuedSkill.isShiftPressed()));
 			}
 		}
 		

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/instance/L2ControllableAirShipInstance.java

@@ -327,7 +327,7 @@ public class L2ControllableAirShipInstance extends L2AirShipInstance
 			if (isVisible() && isEmpty() && !isInDock())
 			{
 				// deleteMe() can't be called from CheckTask because task should not cancel itself
-				ThreadPoolManager.getInstance().executeTask(new DecayTask());
+				ThreadPoolManager.getInstance().executeGeneral(new DecayTask());
 			}
 		}
 	}

+ 2 - 2
L2J_Server_BETA/java/com/l2jserver/gameserver/model/entity/BlockCheckerEngine.java

@@ -307,7 +307,7 @@ public final class BlockCheckerEngine
 				
 				_abnormalEnd = true;
 				
-				ThreadPoolManager.getInstance().executeTask(new EndEvent());
+				ThreadPoolManager.getInstance().executeGeneral(new EndEvent());
 				
 				if (Config.DEBUG)
 				{
@@ -429,7 +429,7 @@ public final class BlockCheckerEngine
 			}
 			_isStarted = true;
 			// Spawn the blocks
-			ThreadPoolManager.getInstance().executeTask(new SpawnRound(16, 1));
+			ThreadPoolManager.getInstance().executeGeneral(new SpawnRound(16, 1));
 			// Start up player parameters
 			setUpPlayers();
 			// Set the started time

+ 3 - 3
L2J_Server_BETA/java/com/l2jserver/gameserver/model/entity/FortSiege.java

@@ -854,7 +854,7 @@ public class FortSiege implements Siegable
 			saveFortSiege();
 			clearSiegeClan(); // remove all clans
 			// spawn suspicious merchant immediately
-			ThreadPoolManager.getInstance().executeTask(new ScheduleSuspiciousMerchantSpawn());
+			ThreadPoolManager.getInstance().executeGeneral(new ScheduleSuspiciousMerchantSpawn());
 		}
 		else
 		{
@@ -869,12 +869,12 @@ public class FortSiege implements Siegable
 				// preparing start siege task
 				if (delay > 3600000) // more than hour, how this can happens ? spawn suspicious merchant
 				{
-					ThreadPoolManager.getInstance().executeTask(new ScheduleSuspiciousMerchantSpawn());
+					ThreadPoolManager.getInstance().executeGeneral(new ScheduleSuspiciousMerchantSpawn());
 					_siegeStartTask = ThreadPoolManager.getInstance().scheduleGeneral(new FortSiege.ScheduleStartSiegeTask(3600), delay - 3600000);
 				}
 				if (delay > 600000) // more than 10 min, spawn suspicious merchant
 				{
-					ThreadPoolManager.getInstance().executeTask(new ScheduleSuspiciousMerchantSpawn());
+					ThreadPoolManager.getInstance().executeGeneral(new ScheduleSuspiciousMerchantSpawn());
 					_siegeStartTask = ThreadPoolManager.getInstance().scheduleGeneral(new FortSiege.ScheduleStartSiegeTask(600), delay - 600000);
 				}
 				else if (delay > 300000)

+ 4 - 4
L2J_Server_BETA/java/com/l2jserver/gameserver/model/entity/TvTManager.java

@@ -96,7 +96,7 @@ public class TvTManager
 			if (nextStartTime != null)
 			{
 				_task = new TvTStartTask(nextStartTime.getTimeInMillis());
-				ThreadPoolManager.getInstance().executeTask(_task);
+				ThreadPoolManager.getInstance().executeGeneral(_task);
 			}
 		}
 		catch (Exception e)
@@ -123,7 +123,7 @@ public class TvTManager
 			
 			// schedule registration end
 			_task.setStartTime(System.currentTimeMillis() + (60000L * Config.TVT_EVENT_PARTICIPATION_TIME));
-			ThreadPoolManager.getInstance().executeTask(_task);
+			ThreadPoolManager.getInstance().executeGeneral(_task);
 		}
 	}
 	
@@ -143,7 +143,7 @@ public class TvTManager
 		{
 			TvTEvent.sysMsgToAllParticipants("TvT Event: Teleporting participants to an arena in " + Config.TVT_EVENT_START_LEAVE_TELEPORT_DELAY + " second(s).");
 			_task.setStartTime(System.currentTimeMillis() + (60000L * Config.TVT_EVENT_RUNNING_TIME));
-			ThreadPoolManager.getInstance().executeTask(_task);
+			ThreadPoolManager.getInstance().executeGeneral(_task);
 		}
 	}
 	
@@ -164,7 +164,7 @@ public class TvTManager
 		if (_task.nextRun.cancel(false))
 		{
 			_task.setStartTime(System.currentTimeMillis());
-			ThreadPoolManager.getInstance().executeTask(_task);
+			ThreadPoolManager.getInstance().executeGeneral(_task);
 		}
 	}
 	

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/model/itemauction/ItemAuction.java

@@ -403,7 +403,7 @@ public final class ItemAuction
 	
 	public final void broadcastToAllBidders(final L2GameServerPacket packet)
 	{
-		ThreadPoolManager.getInstance().executeTask(new Runnable()
+		ThreadPoolManager.getInstance().executeGeneral(new Runnable()
 		{
 			@Override
 			public final void run()

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/model/items/instance/L2ItemInstance.java

@@ -1621,7 +1621,7 @@ public final class L2ItemInstance extends L2Object
 		{
 			return;
 		}
-		ThreadPoolManager.getInstance().executeTask(new ItemDropTask(this, dropper, x, y, z));
+		ThreadPoolManager.getInstance().executeGeneral(new ItemDropTask(this, dropper, x, y, z));
 	}
 	
 	/**

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/model/olympiad/OlympiadGameTask.java

@@ -161,7 +161,7 @@ public final class OlympiadGameTask implements Runnable
 		_game = game;
 		_state = GameState.BEGIN;
 		_needAnnounce = false;
-		ThreadPoolManager.getInstance().executeTask(this);
+		ThreadPoolManager.getInstance().executeGeneral(this);
 	}
 	
 	@Override

+ 2 - 2
L2J_Server_BETA/java/com/l2jserver/gameserver/model/olympiad/OlympiadManager.java

@@ -409,7 +409,7 @@ public class OlympiadManager
 			if ((team != null) && team.contains(objId))
 			{
 				_teamsBasedRegisters.remove(team);
-				ThreadPoolManager.getInstance().executeTask(new AnnounceUnregToTeam(team));
+				ThreadPoolManager.getInstance().executeGeneral(new AnnounceUnregToTeam(team));
 				return true;
 			}
 		}
@@ -441,7 +441,7 @@ public class OlympiadManager
 			if ((team != null) && team.contains(objId))
 			{
 				_teamsBasedRegisters.remove(team);
-				ThreadPoolManager.getInstance().executeTask(new AnnounceUnregToTeam(team));
+				ThreadPoolManager.getInstance().executeGeneral(new AnnounceUnregToTeam(team));
 				return;
 			}
 		}

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/model/zone/type/L2OlympiadStadiumZone.java

@@ -183,7 +183,7 @@ public class L2OlympiadStadiumZone extends L2ZoneRespawn
 				// only participants, observers and GMs allowed
 				if (!player.canOverrideCond(PcCondOverride.ZONE_CONDITIONS) && !player.isInOlympiadMode() && !player.inObserverMode())
 				{
-					ThreadPoolManager.getInstance().executeTask(new KickPlayer(player));
+					ThreadPoolManager.getInstance().executeGeneral(new KickPlayer(player));
 				}
 				else
 				{

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/network/L2GameClient.java

@@ -711,7 +711,7 @@ public final class L2GameClient extends MMOClient<MMOConnection<L2GameClient>> i
 		// no long running tasks here, do it async
 		try
 		{
-			ThreadPoolManager.getInstance().executeTask(new DisconnectTask());
+			ThreadPoolManager.getInstance().executeGeneral(new DisconnectTask());
 		}
 		catch (RejectedExecutionException e)
 		{

+ 1 - 2
L2J_Server_BETA/java/com/l2jserver/gameserver/network/communityserver/CommunityServerThread.java

@@ -247,8 +247,7 @@ public final class CommunityServerThread extends NetConnection
 					
 					if (packet != null)
 					{
-						// new Thread(packet).start();
-						ThreadPoolManager.getInstance().executeCommunityPacket(packet);
+						ThreadPoolManager.getInstance().executePacket(packet);
 					}
 					else
 					{