mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-05 11:27:07 +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:
parent
022362a01a
commit
11fbc8db6f
@ -22,7 +22,7 @@
|
|||||||
"ext-openssl": "*",
|
"ext-openssl": "*",
|
||||||
"ext-pcre": "*",
|
"ext-pcre": "*",
|
||||||
"ext-phar": "*",
|
"ext-phar": "*",
|
||||||
"ext-pmmpthread": "^6.0.7",
|
"ext-pmmpthread": "^6.1.0",
|
||||||
"ext-reflection": "*",
|
"ext-reflection": "*",
|
||||||
"ext-simplexml": "*",
|
"ext-simplexml": "*",
|
||||||
"ext-sockets": "*",
|
"ext-sockets": "*",
|
||||||
|
4
composer.lock
generated
4
composer.lock
generated
@ -4,7 +4,7 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "28633153e56932cbd9e1dbcd7f7e6756",
|
"content-hash": "05f535c2b562b59c11b6ac535b5f1c99",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "adhocore/json-comment",
|
"name": "adhocore/json-comment",
|
||||||
@ -2953,7 +2953,7 @@
|
|||||||
"ext-openssl": "*",
|
"ext-openssl": "*",
|
||||||
"ext-pcre": "*",
|
"ext-pcre": "*",
|
||||||
"ext-phar": "*",
|
"ext-phar": "*",
|
||||||
"ext-pmmpthread": "^6.0.7",
|
"ext-pmmpthread": "^6.1.0",
|
||||||
"ext-reflection": "*",
|
"ext-reflection": "*",
|
||||||
"ext-simplexml": "*",
|
"ext-simplexml": "*",
|
||||||
"ext-sockets": "*",
|
"ext-sockets": "*",
|
||||||
|
@ -23,6 +23,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\utils;
|
namespace pocketmine\utils;
|
||||||
|
|
||||||
|
use pocketmine\thread\Thread;
|
||||||
use pocketmine\thread\ThreadManager;
|
use pocketmine\thread\ThreadManager;
|
||||||
use function count;
|
use function count;
|
||||||
use function exec;
|
use function exec;
|
||||||
@ -122,7 +123,7 @@ final class Process{
|
|||||||
|
|
||||||
//TODO: more OS
|
//TODO: more OS
|
||||||
|
|
||||||
return count(ThreadManager::getInstance()->getAll()) + 2; //MainLogger + Main Thread
|
return Thread::getRunningCount() + 1; //pmmpthread doesn't count the main thread
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user