25.06.2011, 08:23
Quote:
This is variant not good. Very hard for pawn scripters and DestroyThread and not actual onThreadDeath( threadid ).
|
I recommend having a look at this, while its Java, it does give some insight as to the dangers of stopping a thread.
Quote:
Stopping a thread with Thread.stop causes it to unlock all of the monitors that it has locked (as a natural consequence of the unchecked ThreadDeath exception propagating up the stack). If any of the objects previously protected by these monitors were in an inconsistent state, the damaged objects become visible to other threads, potentially resulting in arbitrary behavior. Many uses of stop should be replaced by code that simply modifies some variable to indicate that the target thread should stop running. |