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

Side by Side Diff: src/trusted/service_runtime/linux/thread_suspension.c

Issue 10441152: Debug stub: suspend/resume threads on Linux Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Created 8 years, 6 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/trusted/port/thread.h ('k') | src/trusted/service_runtime/posix/nacl_signal.c » ('j') | 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 <errno.h> 7 #include <errno.h>
8 #include <linux/futex.h> 8 #include <linux/futex.h>
9 #include <signal.h> 9 #include <signal.h>
10 #include <sys/syscall.h> 10 #include <sys/syscall.h>
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 size_t index; 238 size_t index;
239 for (index = 0; index < nap->threads.num_entries; index++) { 239 for (index = 0; index < nap->threads.num_entries; index++) {
240 struct NaClAppThread *natp = NaClGetThreadMu(nap, (int) index); 240 struct NaClAppThread *natp = NaClGetThreadMu(nap, (int) index);
241 if (natp != NULL) { 241 if (natp != NULL) {
242 NaClUntrustedThreadResume(natp); 242 NaClUntrustedThreadResume(natp);
243 } 243 }
244 } 244 }
245 245
246 NaClXMutexUnlock(&nap->threads_mu); 246 NaClXMutexUnlock(&nap->threads_mu);
247 } 247 }
248
249
250 void NaClUntrustedThreadsSuspendAll2(struct NaClApp *nap, struct NaClAppThread * signaled_natp) {
251 size_t index;
252
253 NaClXMutexLock(&nap->threads_mu);
254
255 for (index = 0; index < nap->threads.num_entries; index++) {
256 struct NaClAppThread *natp = NaClGetThreadMu(nap, (int) index);
257 if (natp != NULL && natp != signaled_natp) {
258 NaClUntrustedThreadSuspend(natp, 1/*save_registers*/);
259 }
260 }
261 }
262
263 void NaClUntrustedThreadsResumeAll2(struct NaClApp *nap, struct NaClAppThread *s ignaled_natp) {
264 size_t index;
265 for (index = 0; index < nap->threads.num_entries; index++) {
266 struct NaClAppThread *natp = NaClGetThreadMu(nap, (int) index);
267 if (natp != NULL && natp != signaled_natp) {
268 NaClUntrustedThreadResume(natp);
269 }
270 }
271
272 NaClXMutexUnlock(&nap->threads_mu);
273 }
OLDNEW
« no previous file with comments | « src/trusted/port/thread.h ('k') | src/trusted/service_runtime/posix/nacl_signal.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698