Page 1 of 1

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

Posted: Fri Aug 20, 2010 10:50 pm
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);

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

Posted: Sat Aug 21, 2010 6:09 am
by Probe
yes, inside a try-catch block

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

Posted: Sat Aug 21, 2010 10:02 am
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.