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

Side by Side Diff: src/untrusted/init/thread.h

Issue 25147002: nacl_init Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Created 7 years, 2 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
« no previous file with comments | « src/untrusted/init/simple_service.cc ('k') | src/untrusted/init/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) 2013 The Native Client 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 NATIVE_CLIENT_SRC_UNTRUSTED_INIT_KERNEL_SERVICE_H_
6 #define NATIVE_CLIENT_SRC_UNTRUSTED_INIT_KERNEL_SERVICE_H_
7
8 namespace nacl {
9
10 class Thread;
11
12 typedef void *(*ThreadStartFunction)(
13 Thread *interface);
14
15 typedef int (*ThreadFactoryFunction)(
16 void *factory_data,
17 ThreadStartFunction start_routine,
18 void *thread_data,
19 Thread **out_new_thread);
20
21 class Thread : public RefCountBase {
22 public:
23 virtual int Start();
24 virtual void LaunchCallback() = 0;
25 virtual void Exit(void *thread_return);
26
27 protected:
28 Thread(ThreadFactoryFunction factory,
29 void *factory_data,
30 ThreadStartFunction start_routine,
31 void *thread_data);
32 virtual ~Thread();
33
34 private:
35 ThreadFactoryFunction factory_;
36 void *factory_data_;
37
38 // Whether the thread was successfully started.
39 bool started_;
40
41 // Whether the thread is in the middle of stopping.
42 bool stopping_;
43
44 // Used to pass data to ThreadMain.
45 ThreadStartFunction start_routine_;
46 void *startup_data;
47
48 // The threads's handle.
49 pthread_t thread_;
50
51 DISALLOW_COPY_AND_ASSIGN(Thread);
52 };
53
54 } // namespace nacl
55
56 #endif
OLDNEW
« no previous file with comments | « src/untrusted/init/simple_service.cc ('k') | src/untrusted/init/thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698