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

Side by Side Diff: ppapi/native_client/src/untrusted/irt_stub/thread_creator.c

Issue 1551753002: Build third-party code with -Wall, build chromium_code with -Wextra on Linux (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: thestig Created 4 years, 11 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 * Copyright (c) 2012 The Chromium 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 #include "ppapi/native_client/src/untrusted/irt_stub/thread_creator.h" 7 #include "ppapi/native_client/src/untrusted/irt_stub/thread_creator.h"
8 8
9 #include <pthread.h> 9 #include <pthread.h>
10 10
(...skipping 12 matching lines...) Expand all
23 23
24 return pthread_create((pthread_t *) tid, NULL, 24 return pthread_create((pthread_t *) tid, NULL,
25 (void *(*)(void *thread_argument)) func, 25 (void *(*)(void *thread_argument)) func,
26 thread_argument); 26 thread_argument);
27 } 27 }
28 28
29 static int thread_join(uintptr_t tid) { 29 static int thread_join(uintptr_t tid) {
30 return pthread_join((pthread_t) tid, NULL); 30 return pthread_join((pthread_t) tid, NULL);
31 } 31 }
32 32
33 const static struct PP_ThreadFunctions thread_funcs = { 33 static const struct PP_ThreadFunctions thread_funcs = {
34 thread_create, 34 thread_create,
35 thread_join 35 thread_join
36 }; 36 };
37 37
38 /* 38 /*
39 * We cannot tell at link time whether the application uses PPB_Audio, 39 * We cannot tell at link time whether the application uses PPB_Audio,
40 * because of the way that PPAPI is defined via runtime interface 40 * because of the way that PPAPI is defined via runtime interface
41 * query rather than a set of static functions. This means that we 41 * query rather than a set of static functions. This means that we
42 * register the audio thread functions unconditionally. This adds the 42 * register the audio thread functions unconditionally. This adds the
43 * small overhead of pulling in pthread_create() even if the 43 * small overhead of pulling in pthread_create() even if the
44 * application does not use PPB_Audio or libpthread. 44 * application does not use PPB_Audio or libpthread.
45 * 45 *
46 * If an application developer wants to avoid that cost, they can 46 * If an application developer wants to avoid that cost, they can
47 * override this function with an empty definition. 47 * override this function with an empty definition.
48 */ 48 */
49 void __nacl_register_thread_creator(const struct nacl_irt_ppapihook *hooks) { 49 void __nacl_register_thread_creator(const struct nacl_irt_ppapihook *hooks) {
50 hooks->ppapi_register_thread_creator(&thread_funcs); 50 hooks->ppapi_register_thread_creator(&thread_funcs);
51 } 51 }
OLDNEW
« no previous file with comments | « net/tools/quic/quic_simple_server_stream_test.cc ('k') | third_party/android_crazy_linker/src/src/crazy_linker_leb128.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698