| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |