Commit 56a0d001 authored by Peter Marshall's avatar Peter Marshall Committed by Commit Bot

[tracing] Implement RunsTasksOnCurrentThread() properly

Perfetto will actually call this from the main thread in various cases
so we need to implement it.

Cq-Include-Trybots: luci.v8.try:v8_linux64_perfetto_dbg_ng
Bug: v8:8339
Change-Id: I509fa277fb0f7e98e9dea4d991a2d313e0a249da
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1599183Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61320}
parent 138a05b9
...@@ -34,14 +34,11 @@ void PerfettoTaskRunner::PostDelayedTask(std::function<void()> f, ...@@ -34,14 +34,11 @@ void PerfettoTaskRunner::PostDelayedTask(std::function<void()> f,
} }
bool PerfettoTaskRunner::RunsTasksOnCurrentThread() const { bool PerfettoTaskRunner::RunsTasksOnCurrentThread() const {
// TODO(petermarshall): Can be called from the V8 main thread in some return runner_.RunsTasksOnCurrentThread();
// situations so we actually need to implement this properly.
return true;
} }
void PerfettoTaskRunner::FinishImmediateTasks() { void PerfettoTaskRunner::FinishImmediateTasks() {
// TODO(petermarshall): Add a check !RunsTasksOnCurrentThread() once that is DCHECK(!RunsTasksOnCurrentThread());
// implemented properly.
base::Semaphore semaphore(0); base::Semaphore semaphore(0);
// PostTask has guaranteed ordering so this will be the last task executed. // PostTask has guaranteed ordering so this will be the last task executed.
runner_.PostTask( runner_.PostTask(
......
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