Commit c7a8627b authored by Clemens Backes's avatar Clemens Backes Committed by V8 LUCI CQ

[d8][predictable] Don't wait for background work

This fixes a little mistake from https://crrev.com/c/2182453. In
predictable mode (where we do not have any threads for executing
background work) we are executing everything on the main thread, but we
should never wait for background work to be spawned. Otherwise we can
deadlock if the last background task spawned new foreground work, but we
keep waiting for more background work to arrive.

Generally, any blocking in predictable mode will block forever, because
there is no one to spawn any work concurrently (foreground or
background). But the blocking for foreground work has to be there for
non-predictable mode, thus keep it for now, and only remove waiting for
background work.

R=ahaas@chromium.org

Bug: v8:11848
Change-Id: I51c976f6858db8120baa4c47d28840a1041d7fea
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2940885Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74962}
parent 243f753d
......@@ -4542,7 +4542,8 @@ bool ProcessMessages(
// executed.
while (v8::platform::PumpMessageLoop(
g_default_platform,
kProcessGlobalPredictablePlatformWorkerTaskQueue, behavior())) {
kProcessGlobalPredictablePlatformWorkerTaskQueue,
platform::MessageLoopBehavior::kDoNotWait)) {
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment