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

Unified 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, 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/trusted/service_runtime/linux/thread_suspension.c
diff --git a/src/trusted/service_runtime/linux/thread_suspension.c b/src/trusted/service_runtime/linux/thread_suspension.c
index ee4bda227928b47524dc0be0a87af0ee0fd8ef52..64035481c27ea11a58cfddf37d4c46d9434db1ef 100644
--- a/src/trusted/service_runtime/linux/thread_suspension.c
+++ b/src/trusted/service_runtime/linux/thread_suspension.c
@@ -245,3 +245,29 @@ void NaClUntrustedThreadsResumeAll(struct NaClApp *nap) {
NaClXMutexUnlock(&nap->threads_mu);
}
+
+
+void NaClUntrustedThreadsSuspendAll2(struct NaClApp *nap, struct NaClAppThread *signaled_natp) {
+ size_t index;
+
+ NaClXMutexLock(&nap->threads_mu);
+
+ for (index = 0; index < nap->threads.num_entries; index++) {
+ struct NaClAppThread *natp = NaClGetThreadMu(nap, (int) index);
+ if (natp != NULL && natp != signaled_natp) {
+ NaClUntrustedThreadSuspend(natp, 1/*save_registers*/);
+ }
+ }
+}
+
+void NaClUntrustedThreadsResumeAll2(struct NaClApp *nap, struct NaClAppThread *signaled_natp) {
+ size_t index;
+ for (index = 0; index < nap->threads.num_entries; index++) {
+ struct NaClAppThread *natp = NaClGetThreadMu(nap, (int) index);
+ if (natp != NULL && natp != signaled_natp) {
+ NaClUntrustedThreadResume(natp);
+ }
+ }
+
+ NaClXMutexUnlock(&nap->threads_mu);
+}
« 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