mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-05 17:36:12 +00:00
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:
@ -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
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user