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

Unified Diff: runtime/vm/thread_pool.cc

Issue 2481873005: clang-format runtime/vm (Closed)
Patch Set: Merge Created 4 years, 1 month 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 | « runtime/vm/thread_pool.h ('k') | runtime/vm/thread_pool_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/thread_pool.cc
diff --git a/runtime/vm/thread_pool.cc b/runtime/vm/thread_pool.cc
index 0c326d34ff67dfbf3bc7b7813bb61fab08c4fd5d..40ca9d57ec344bd7763db51a9c4a53ab695dd953 100644
--- a/runtime/vm/thread_pool.cc
+++ b/runtime/vm/thread_pool.cc
@@ -10,20 +10,21 @@
namespace dart {
-DEFINE_FLAG(int, worker_timeout_millis, 5000,
+DEFINE_FLAG(int,
+ worker_timeout_millis,
+ 5000,
"Free workers when they have been idle for this amount of time.");
ThreadPool::ThreadPool()
- : shutting_down_(false),
- all_workers_(NULL),
- idle_workers_(NULL),
- count_started_(0),
- count_stopped_(0),
- count_running_(0),
- count_idle_(0),
- shutting_down_workers_(NULL),
- join_list_(NULL) {
-}
+ : shutting_down_(false),
+ all_workers_(NULL),
+ idle_workers_(NULL),
+ count_started_(0),
+ count_stopped_(0),
+ count_running_(0),
+ count_idle_(0),
+ shutting_down_workers_(NULL),
+ join_list_(NULL) {}
ThreadPool::~ThreadPool() {
@@ -146,8 +147,7 @@ void ThreadPool::Shutdown() {
bool ThreadPool::IsIdle(Worker* worker) {
ASSERT(worker != NULL && worker->owned_);
- for (Worker* current = idle_workers_;
- current != NULL;
+ for (Worker* current = idle_workers_; current != NULL;
current = current->idle_next_) {
if (current == worker) {
return true;
@@ -170,8 +170,7 @@ bool ThreadPool::RemoveWorkerFromIdleList(Worker* worker) {
return true;
}
- for (Worker* current = idle_workers_;
- current->idle_next_ != NULL;
+ for (Worker* current = idle_workers_; current->idle_next_ != NULL;
current = current->idle_next_) {
if (current->idle_next_ == worker) {
current->idle_next_ = worker->idle_next_;
@@ -198,8 +197,7 @@ bool ThreadPool::RemoveWorkerFromAllList(Worker* worker) {
return true;
}
- for (Worker* current = all_workers_;
- current->all_next_ != NULL;
+ for (Worker* current = all_workers_; current->all_next_ != NULL;
current = current->all_next_) {
if (current->all_next_ == worker) {
current->all_next_ = worker->all_next_;
@@ -298,8 +296,7 @@ bool ThreadPool::RemoveWorkerFromShutdownList(Worker* worker) {
}
for (Worker* current = shutting_down_workers_;
- current->shutdown_next_ != NULL;
- current = current->shutdown_next_) {
+ current->shutdown_next_ != NULL; current = current->shutdown_next_) {
if (current->shutdown_next_ == worker) {
current->shutdown_next_ = worker->shutdown_next_;
worker->shutdown_next_ = NULL;
@@ -325,24 +322,21 @@ void ThreadPool::JoinList::Join(JoinList** list) {
}
-ThreadPool::Task::Task() {
-}
+ThreadPool::Task::Task() {}
-ThreadPool::Task::~Task() {
-}
+ThreadPool::Task::~Task() {}
ThreadPool::Worker::Worker(ThreadPool* pool)
- : pool_(pool),
- task_(NULL),
- id_(OSThread::kInvalidThreadId),
- done_(false),
- owned_(false),
- all_next_(NULL),
- idle_next_(NULL),
- shutdown_next_(NULL) {
-}
+ : pool_(pool),
+ task_(NULL),
+ id_(OSThread::kInvalidThreadId),
+ done_(false),
+ owned_(false),
+ all_next_(NULL),
+ idle_next_(NULL),
+ shutdown_next_(NULL) {}
ThreadId ThreadPool::Worker::id() {
@@ -354,13 +348,12 @@ ThreadId ThreadPool::Worker::id() {
void ThreadPool::Worker::StartThread() {
#if defined(DEBUG)
// Must call SetTask before StartThread.
- { // NOLINT
+ { // NOLINT
MonitorLocker ml(&monitor_);
ASSERT(task_ != NULL);
}
#endif
- int result = OSThread::Start("Dart ThreadPool Worker",
- &Worker::Main,
+ int result = OSThread::Start("Dart ThreadPool Worker", &Worker::Main,
reinterpret_cast<uword>(this));
if (result != 0) {
FATAL1("Could not start worker thread: result = %d.", result);
@@ -478,8 +471,8 @@ void ThreadPool::Worker::Main(uword args) {
JoinList::AddLocked(join_id, &pool->join_list_);
}
- // worker->id_ should never be read again, so set to invalid in debug mode
- // for asserts.
+// worker->id_ should never be read again, so set to invalid in debug mode
+// for asserts.
#if defined(DEBUG)
{
MonitorLocker ml(&worker->monitor_);
« no previous file with comments | « runtime/vm/thread_pool.h ('k') | runtime/vm/thread_pool_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698