OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ppapi/utility/threading/simple_thread.h" | 5 #include "ppapi/utility/threading/simple_thread.h" |
6 | 6 |
7 #ifdef WIN32 | 7 #ifdef WIN32 |
8 #include <windows.h> | 8 #include <windows.h> |
9 #endif | 9 #endif |
10 | 10 |
11 namespace pp { | 11 namespace pp { |
12 | 12 |
13 namespace { | 13 namespace { |
14 | 14 |
15 struct ThreadData { | 15 struct ThreadData { |
16 MessageLoop_Dev message_loop; | 16 MessageLoop message_loop; |
17 | 17 |
18 SimpleThread::ThreadFunc func; | 18 SimpleThread::ThreadFunc func; |
19 void* user_data; | 19 void* user_data; |
20 }; | 20 }; |
21 | 21 |
22 #ifdef WIN32 | 22 #ifdef WIN32 |
23 DWORD WINAPI RunThread(void* void_data) { | 23 DWORD WINAPI RunThread(void* void_data) { |
24 #else | 24 #else |
25 void* RunThread(void* void_data) { | 25 void* RunThread(void* void_data) { |
26 #endif | 26 #endif |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 #else | 87 #else |
88 if (pthread_create(&thread_, NULL, &RunThread, data) != 0) { | 88 if (pthread_create(&thread_, NULL, &RunThread, data) != 0) { |
89 #endif | 89 #endif |
90 delete data; | 90 delete data; |
91 return false; | 91 return false; |
92 } | 92 } |
93 return true; | 93 return true; |
94 } | 94 } |
95 | 95 |
96 } // namespace pp | 96 } // namespace pp |
OLD | NEW |