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

Unified Diff: tools/android/forwarder2/thread.cc

Issue 19478003: Remove Thread wrapper class in forwarder2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Marcus' comments Created 7 years, 5 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 | « tools/android/forwarder2/thread.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/android/forwarder2/thread.cc
diff --git a/tools/android/forwarder2/thread.cc b/tools/android/forwarder2/thread.cc
deleted file mode 100644
index 45b7558f5f20c4165b4663fbb43f30c014bb2049..0000000000000000000000000000000000000000
--- a/tools/android/forwarder2/thread.cc
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "tools/android/forwarder2/thread.h"
-
-#include "base/logging.h"
-
-namespace forwarder2 {
-
-Thread::Thread() : thread_(static_cast<pthread_t>(-1)) {}
-
-Thread::~Thread() {}
-
-void Thread::Start() {
- int ret = pthread_create(&thread_, NULL, &ThreadCallback, this);
- CHECK_EQ(0, ret);
-}
-
-void Thread::Detach() {
- CHECK_NE(static_cast<pthread_t>(-1), thread_);
- int ret = pthread_detach(thread_);
- CHECK_EQ(0, ret);
-}
-
-void Thread::Join() {
- CHECK_NE(static_cast<pthread_t>(-1), thread_);
- int ret = pthread_join(thread_, NULL);
- CHECK_EQ(0, ret);
-}
-
-// static
-void* Thread::ThreadCallback(void* arg) {
- CHECK(arg);
- Thread* obj = reinterpret_cast<Thread*>(arg);
- obj->Run();
- return NULL;
-}
-
-} // namespace forwarder
« no previous file with comments | « tools/android/forwarder2/thread.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698