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

Side by Side Diff: tests/thread_suspension/suspend_test_host.c

Issue 10392005: Thread suspension: Implement for Linux (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Comment about docs Created 8 years, 7 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 | « tests/thread_suspension/nacl.scons ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. 2 * Copyright (c) 2012 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 #include "native_client/tests/thread_suspension/suspend_test.h" 7 #include "native_client/tests/thread_suspension/suspend_test.h"
8 8
9 #include "native_client/src/include/portability_io.h" 9 #include "native_client/src/include/portability_io.h"
10 #include "native_client/src/shared/gio/gio.h" 10 #include "native_client/src/shared/gio/gio.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 int main(int argc, char **argv) { 130 int main(int argc, char **argv) {
131 struct NaClApp app; 131 struct NaClApp app;
132 struct GioMemoryFileSnapshot gio_file; 132 struct GioMemoryFileSnapshot gio_file;
133 133
134 /* Turn off buffering to aid debugging. */ 134 /* Turn off buffering to aid debugging. */
135 setvbuf(stdout, NULL, _IONBF, 0); 135 setvbuf(stdout, NULL, _IONBF, 0);
136 setvbuf(stderr, NULL, _IONBF, 0); 136 setvbuf(stderr, NULL, _IONBF, 0);
137 137
138 NaClAllModulesInit(); 138 NaClAllModulesInit();
139 139
140 #if NACL_LINUX
141 NaClSignalHandlerInit();
142 #endif
143
140 if (argc != 2) { 144 if (argc != 2) {
141 NaClLog(LOG_FATAL, "Expected 1 argument: executable filename\n"); 145 NaClLog(LOG_FATAL, "Expected 1 argument: executable filename\n");
142 } 146 }
143 147
144 NaClFileNameForValgrind(argv[1]); 148 NaClFileNameForValgrind(argv[1]);
145 CHECK(GioMemoryFileSnapshotCtor(&gio_file, argv[1])); 149 CHECK(GioMemoryFileSnapshotCtor(&gio_file, argv[1]));
146 CHECK(NaClAppCtor(&app)); 150 CHECK(NaClAppCtor(&app));
147 CHECK(NaClAppLoadFile((struct Gio *) &gio_file, &app) == LOAD_OK); 151 CHECK(NaClAppLoadFile((struct Gio *) &gio_file, &app) == LOAD_OK);
148 CHECK(NaClAppPrepareToLaunch(&app) == LOAD_OK); 152 CHECK(NaClAppPrepareToLaunch(&app) == LOAD_OK);
149 153
(...skipping 11 matching lines...) Expand all
161 165
162 printf("Running TrySuspendingSyscallInvokerThread...\n"); 166 printf("Running TrySuspendingSyscallInvokerThread...\n");
163 TrySuspendingSyscallInvokerThread(&app); 167 TrySuspendingSyscallInvokerThread(&app);
164 168
165 /* 169 /*
166 * Avoid calling exit() because it runs process-global destructors 170 * Avoid calling exit() because it runs process-global destructors
167 * which might break code that is running in our unjoined threads. 171 * which might break code that is running in our unjoined threads.
168 */ 172 */
169 NaClExit(0); 173 NaClExit(0);
170 } 174 }
OLDNEW
« no previous file with comments | « tests/thread_suspension/nacl.scons ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698