[+] TaskRunner::PostSignalTask

Instead of chaining waitables, or checking for nested state, or blocks; these tasks are assumed to be thread-local condition variable dispatchers.

Last aurora commit: 87131415
This commit is contained in:
Reece Wilson 2023-02-07 17:17:50 +00:00
parent 87131415c9
commit baf6668e16
4 changed files with 5 additions and 3 deletions

View File

@ -149,6 +149,8 @@ class TaskRunner {
TaskRunner(const TaskRunner&) = delete;
TaskRunner& operator=(const TaskRunner&) = delete;
virtual void PostSignalTask(std::unique_ptr<Task> task) = 0;
};
/**

View File

@ -116,7 +116,7 @@ void CollectionBarrier::ActivateStackGuardAndPostTask() {
V8::GetCurrentPlatform()
->GetForegroundTaskRunner(reinterpret_cast<v8::Isolate*>(isolate))
->PostTask(std::make_unique<BackgroundCollectionInterruptTask>(heap_));
->PostSignalTask(std::make_unique<BackgroundCollectionInterruptTask>(heap_));
}
void CollectionBarrier::StopTimeToCollectionTimer() {

View File

@ -4114,7 +4114,7 @@ void Heap::MemoryPressureNotification(MemoryPressureLevel level,
isolate()->stack_guard()->RequestGC();
auto taskrunner = V8::GetCurrentPlatform()->GetForegroundTaskRunner(
reinterpret_cast<v8::Isolate*>(isolate()));
taskrunner->PostTask(std::make_unique<MemoryPressureInterruptTask>(this));
taskrunner->PostSignalTask(std::make_unique<MemoryPressureInterruptTask>(this));
}
}
}

View File

@ -115,7 +115,7 @@ void IsolateSafepoint::InitiateGlobalSafepointScopeRaw(
// wake it up.
V8::GetCurrentPlatform()
->GetForegroundTaskRunner(reinterpret_cast<v8::Isolate*>(isolate()))
->PostTask(std::make_unique<GlobalSafepointInterruptTask>(heap_));
->PostSignalTask(std::make_unique<GlobalSafepointInterruptTask>(heap_));
// Request an interrupt in case of long-running code.
isolate()->stack_guard()->RequestGlobalSafepoint();