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

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

Issue 10918057: Add forwarder2 (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 3 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
« no previous file with comments | « tools/android/forwarder2/socket.cc ('k') | tools/android/forwarder2/thread.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 forwarder {
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 virtual void Join();
22
23 protected:
24 virtual void Run() = 0;
25
26 private:
27 static void* ThreadCallback(void* arg);
28
29 pthread_t thread_;
30 };
31
32 } // namespace forwarder
33
34 #endif // TOOLS_ANDROID_FORWARDER2_THREAD_H_
OLDNEW
« no previous file with comments | « tools/android/forwarder2/socket.cc ('k') | tools/android/forwarder2/thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698