Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit835089c

Browse files
committed
[Process] Add support for Fiber
1 parentff70bd1 commit835089c

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

‎src/Symfony/Component/Process/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
CHANGELOG
22
=========
3+
5.4.0
4+
5+
-----
6+
7+
* added support for`Fiber`
38

49
5.2.0
510
-----

‎src/Symfony/Component/Process/Process.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,12 +427,22 @@ public function wait(callable $callback = null)
427427
do {
428428
$this->checkTimeout();
429429
$running ='\\' === \DIRECTORY_SEPARATOR ?$this->isRunning() :$this->processPipes->areOpen();
430-
$this->readPipes($running,'\\' !== \DIRECTORY_SEPARATOR || !$running);
430+
431+
if (\PHP_VERSION_ID >=80100 && \Fiber::getCurrent()) {
432+
$this->readPipes(false,'\\' !== \DIRECTORY_SEPARATOR || !$running);
433+
\Fiber::suspend();
434+
}else {
435+
$this->readPipes($running,'\\' !== \DIRECTORY_SEPARATOR || !$running);
436+
}
431437
}while ($running);
432438

433439
while ($this->isRunning()) {
434440
$this->checkTimeout();
435-
usleep(1000);
441+
if (\PHP_VERSION_ID >=80100 && \Fiber::getCurrent()) {
442+
\Fiber::suspend();
443+
}else {
444+
usleep(1000);
445+
}
436446
}
437447

438448
if ($this->processInformation['signaled'] &&$this->processInformation['termsig'] !==$this->latestSignal) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp