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
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
3 changed files with 5 additions and 4 deletions

View File

@ -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
View File

@ -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": "*",

View File

@ -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
} }
/** /**