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

Side by Side Diff: tools/android/forwarder2/thread.h

Issue 19478003: Remove Thread wrapper class in forwarder2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Digit's 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef TOOLS_ANDROID_FORWARDER2_THREAD_H_
6 #define TOOLS_ANDROID_FORWARDER2_THREAD_H_
7
8 #include <pthread.h>
9
10 namespace forwarder2 {
11
12 // Helper abstract class to create a new thread and curry the
13 // call to the Run() method in an object from the new thread.
14 class Thread {
15 public:
16 Thread();
17 virtual ~Thread();
18
19 // Start thread calling Run().
20 void Start();
21 void Detach();
22 virtual void Join();
23
24 protected:
25 virtual void Run() = 0;
26
27 private:
28 static void* ThreadCallback(void* arg);
29
30 pthread_t thread_;
31 };
32
33 } // namespace forwarder
34
35 #endif // TOOLS_ANDROID_FORWARDER2_THREAD_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698