OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 The Native Client Authors. All rights reserved. | 2 * Copyright 2015 The Native Client Authors. All rights reserved. |
3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
5 */ | 5 */ |
6 | 6 |
7 #ifndef NATIVE_CLIENT_SRC_NONSFI_LINUX_LINUX_PTHREAD_PRIVATE_H_ | 7 #ifndef NATIVE_CLIENT_SRC_NONSFI_LINUX_LINUX_PTHREAD_PRIVATE_H_ |
8 #define NATIVE_CLIENT_SRC_NONSFI_LINUX_LINUX_PTHREAD_PRIVATE_H_ 1 | 8 #define NATIVE_CLIENT_SRC_NONSFI_LINUX_LINUX_PTHREAD_PRIVATE_H_ 1 |
9 | 9 |
10 #include <stdint.h> | 10 #include <stdint.h> |
11 | 11 |
12 #include "native_client/src/include/nacl_base.h" | 12 #include "native_client/src/include/nacl_base.h" |
| 13 #include "native_client/src/untrusted/irt/irt.h" |
13 | 14 |
14 EXTERN_C_BEGIN | 15 EXTERN_C_BEGIN |
15 | 16 |
16 /* | 17 /* |
17 * Creates a new thread by calling clone(). This function does use the |stack| | 18 * Creates a new thread by calling clone(). This function does use the |stack| |
18 * parameter and the thread's entrypoint is |start_func| with |thread_ptr| as | 19 * parameter and the thread's entrypoint is |start_func| with |thread_ptr| as |
19 * its parameter. | 20 * its parameter. |
20 */ | 21 */ |
21 int nacl_user_thread_create(void *(*start_func)(void *), void *stack, | 22 int nacl_user_thread_create(void *(*start_func)(void *), void *stack, |
22 void *thread_ptr); | 23 void *thread_ptr, nacl_irt_tid_t *child_tid); |
23 | 24 |
24 /* | 25 /* |
25 * Exits a thread started by |nacl_user_thread_create|. Threads started with | 26 * Exits a thread started by |nacl_user_thread_create|. Threads started with |
26 * pthread_create() should terminate by calling pthread_exit() instead. | 27 * pthread_create() should terminate by calling pthread_exit() instead. |
27 */ | 28 */ |
28 void nacl_user_thread_exit(int32_t *stack_flag); | 29 void nacl_user_thread_exit(int32_t *stack_flag); |
29 | 30 |
30 EXTERN_C_END | 31 EXTERN_C_END |
31 | 32 |
32 #endif | 33 #endif |
OLD | NEW |