Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion kphp_polyfills.php
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,12 @@ function wait_synchronously($id) {
function wait_concurrently($id) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you figure out what's going on in this function?
As far as I can see, it always requests undefined index at line 333, and the condition !$waiting[$id] is always true

static $waiting = [];

if (!_php_wait_helper($id)) {
return false;
}

if (!$waiting[$id]) {
$waiting[$id] = true;
_php_wait_helper($id);
unset($waiting[$id]);
} else {
while ($waiting[$id]) {
Expand All @@ -338,6 +341,7 @@ function wait_concurrently($id) {
}
}
}
return true;
}

function wait_queue_create(array $futures): array {
Expand Down