mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-03 00:25:04 +00:00
Improve and simplify AsyncTask thread-local storage
This is now self-maintaining and doesn't rely on the async pool to wipe its ass on task completion. Instead, the garbage collector will cause thread-local data to be automatically released when the async task is garbage-collected on the main thread.
This commit is contained in:
@ -54,7 +54,7 @@ class TestAsyncTask extends AsyncTask{
|
||||
usleep(50 * 1000); //1 server tick
|
||||
}
|
||||
|
||||
public function __destruct(){
|
||||
protected function reallyDestruct() : void{
|
||||
self::$destroyed = true;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user