Make use of pmmpthread 6.1.0 for Thread::getRunningCount()

ThreadManager doesn't count these correctly anymore since pmmpthread since thread-safe statics aren't copied anymore.
This commit is contained in:
Dylan K. Taylor
2024-04-02 19:40:44 +01:00
parent 022362a01a
commit 11fbc8db6f
3 changed files with 5 additions and 4 deletions

View File

@ -23,6 +23,7 @@ declare(strict_types=1);
namespace pocketmine\utils;
use pocketmine\thread\Thread;
use pocketmine\thread\ThreadManager;
use function count;
use function exec;
@ -122,7 +123,7 @@ final class Process{
//TODO: more OS
return count(ThreadManager::getInstance()->getAll()) + 2; //MainLogger + Main Thread
return Thread::getRunningCount() + 1; //pmmpthread doesn't count the main thread
}
/**