Commit b187fab2 authored by Gabriel Charette's avatar Gabriel Charette Committed by Commit Bot

[base] Add thread annotations on ScopedTaskEnvironment::TestTaskTracker

R=alexclarke@chromium.org

Change-Id: I4c0aa2178c4776cb1ca0bd99f59eb4fda114e99e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1642733
Auto-Submit: Gabriel Charette <gab@chromium.org>
Reviewed-by: default avatarAlex Clarke <alexclarke@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#665906}
parent 89b19061
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include "base/test/bind_test_util.h" #include "base/test/bind_test_util.h"
#include "base/test/test_mock_time_task_runner.h" #include "base/test/test_mock_time_task_runner.h"
#include "base/test/test_timeouts.h" #include "base/test/test_timeouts.h"
#include "base/thread_annotations.h"
#include "base/threading/sequence_local_storage_map.h" #include "base/threading/sequence_local_storage_map.h"
#include "base/threading/thread_local.h" #include "base/threading/thread_local.h"
#include "base/threading/thread_restrictions.h" #include "base/threading/thread_restrictions.h"
...@@ -304,16 +305,16 @@ class ScopedTaskEnvironment::TestTaskTracker ...@@ -304,16 +305,16 @@ class ScopedTaskEnvironment::TestTaskTracker
Lock lock_; Lock lock_;
// True if running tasks is allowed. // True if running tasks is allowed.
bool can_run_tasks_ = true; bool can_run_tasks_ GUARDED_BY(lock_) = true;
// Signaled when |can_run_tasks_| becomes true. // Signaled when |can_run_tasks_| becomes true.
ConditionVariable can_run_tasks_cv_; ConditionVariable can_run_tasks_cv_ GUARDED_BY(lock_);
// Signaled when a task is completed. // Signaled when a task is completed.
ConditionVariable task_completed_; ConditionVariable task_completed_ GUARDED_BY(lock_);
// Number of tasks that are currently running. // Number of tasks that are currently running.
int num_tasks_running_ = 0; int num_tasks_running_ GUARDED_BY(lock_) = 0;
DISALLOW_COPY_AND_ASSIGN(TestTaskTracker); DISALLOW_COPY_AND_ASSIGN(TestTaskTracker);
}; };
......
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