[Help] please help with this thread thing...

If something doesn't fit in any other forum then post it here.
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
User avatar
kotkot90
Posts: 30
Joined: Sat Jun 19, 2010 2:01 pm

[Help] please help with this thread thing...

Post by kotkot90 »

I put my own thread at a place in the code as follows:

Code: Select all

 _spawnTask = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new SpawnMonstersTask(activeChar), 2000, 6000); 
I want this thread to stop when the player logs out. Where is the place where all the player's threads are killed when he logs out, so I put the code to stop it?

And, is this code right to stop this thread?

Code: Select all

_spawnTask.cancel(true);
Probe
Posts: 915
Joined: Thu Sep 03, 2009 6:36 pm
Location: Israel
Contact:

Re: [Help] please help with this thread thing...

Post by Probe »

yes, inside a try-catch block
User avatar
kotkot90
Posts: 30
Joined: Sat Jun 19, 2010 2:01 pm

Re: [Help] please help with this thread thing...

Post by kotkot90 »

Probe wrote:yes, inside a try-catch block
I don't ask this, I want to know where in the code is the location where all threads close as the player logs out.
Post Reply