Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Unified Diff: third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h

Issue 2781323003: [scheduler] Split lock in TaskQueueImpl. (Closed)
Patch Set: Addressed comments Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h
diff --git a/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h b/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h
index 154491d76f0058b7811faac702a06ee33e7f7394..a50de1563f30f67241260e9d44d8430e1359fb42 100644
--- a/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h
+++ b/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h
@@ -254,8 +254,6 @@ class BLINK_PLATFORM_EXPORT TaskQueueImpl final : public TaskQueue {
// main thread, so it should be locked before accessing from other threads.
TaskQueueManager* task_queue_manager;
TimeDomain* time_domain;
-
- WTF::Deque<Task> immediate_incoming_queue;
};
struct MainThreadOnly {
@@ -319,7 +317,7 @@ class BLINK_PLATFORM_EXPORT TaskQueueImpl final : public TaskQueue {
// Can be called from any thread.
WTF::Deque<TaskQueueImpl::Task> TakeImmediateIncomingQueue();
- void TraceQueueSize(bool is_locked) const;
+ void TraceQueueSize() const;
static void QueueAsValueInto(const WTF::Deque<Task>& queue,
base::trace_event::TracedValue* state);
static void QueueAsValueInto(const std::priority_queue<Task>& queue,
@@ -360,6 +358,17 @@ class BLINK_PLATFORM_EXPORT TaskQueueImpl final : public TaskQueue {
return main_thread_only_;
}
+ mutable base::Lock immediate_incoming_queue_lock_;
+ WTF::Deque<Task> immediate_incoming_queue_;
+ WTF::Deque<Task>& immediate_incoming_queue() {
+ immediate_incoming_queue_lock_.AssertAcquired();
+ return immediate_incoming_queue_;
+ }
+ const WTF::Deque<Task>& immediate_incoming_queue() const {
+ immediate_incoming_queue_lock_.AssertAcquired();
+ return immediate_incoming_queue_;
+ }
+
const bool should_monitor_quiescence_;
const bool should_notify_observers_;
const bool should_report_when_execution_blocked_;
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698