custom threads: use PTHREADS_INHERIT_NONE by default

this has the most reliable behaviour, because some stuff like respect/validation likes to include files unconditionally which declare functions that are already declared, which breaks due to the lack of function autoloading.
This commit is contained in:
Dylan K. Taylor 2020-12-01 22:32:59 +00:00
parent 541cfee615
commit 6d6f8c3c38
2 changed files with 4 additions and 4 deletions

View File

@ -23,7 +23,7 @@ declare(strict_types=1);
namespace pocketmine\thread;
use const PTHREADS_INHERIT_ALL;
use const PTHREADS_INHERIT_NONE;
/**
* This class must be extended by all custom threading classes
@ -31,7 +31,7 @@ use const PTHREADS_INHERIT_ALL;
abstract class Thread extends \Thread{
use CommonThreadPartsTrait;
public function start(int $options = PTHREADS_INHERIT_ALL) : bool{
public function start(int $options = PTHREADS_INHERIT_NONE) : bool{
//this is intentionally not traitified
ThreadManager::getInstance()->add($this);

View File

@ -23,7 +23,7 @@ declare(strict_types=1);
namespace pocketmine\thread;
use const PTHREADS_INHERIT_ALL;
use const PTHREADS_INHERIT_NONE;
/**
* This class must be extended by all custom threading classes
@ -31,7 +31,7 @@ use const PTHREADS_INHERIT_ALL;
abstract class Worker extends \Worker{
use CommonThreadPartsTrait;
public function start(int $options = PTHREADS_INHERIT_ALL) : bool{
public function start(int $options = PTHREADS_INHERIT_NONE) : bool{
//this is intentionally not traitified
ThreadManager::getInstance()->add($this);