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:
Dylan K. Taylor
2018-10-08 12:48:44 +01:00
parent 2bc663968e
commit 6ac0c517f5
3 changed files with 48 additions and 86 deletions

View File

@ -54,7 +54,7 @@ class TestAsyncTask extends AsyncTask{
usleep(50 * 1000); //1 server tick
}
public function __destruct(){
protected function reallyDestruct() : void{
self::$destroyed = true;
}
}