| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2008 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2011 The Native Client Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can | 3 * Use of this source code is governed by a BSD-style license that can be |
| 4 * be found in the LICENSE file. | 4 * found in the LICENSE file. |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 /* | 7 /* |
| 8 * NaCl Simple/secure ELF loader (NaCl SEL). | 8 * NaCl Simple/secure ELF loader (NaCl SEL). |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 #include "native_client/src/include/portability.h" | 11 #include "native_client/src/include/portability.h" |
| 12 | 12 |
| 13 #include <stdio.h> | 13 #include <stdio.h> |
| 14 #include <stdlib.h> | 14 #include <stdlib.h> |
| (...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 724 (uintptr_t) work->vtbl->Run); | 724 (uintptr_t) work->vtbl->Run); |
| 725 | 725 |
| 726 (*work->vtbl->Run)(work); | 726 (*work->vtbl->Run)(work); |
| 727 NaClLog(3, "... done\n"); | 727 NaClLog(3, "... done\n"); |
| 728 } | 728 } |
| 729 | 729 |
| 730 NaClLog(3, " taking NaClApp lock\n"); | 730 NaClLog(3, " taking NaClApp lock\n"); |
| 731 NaClXMutexLock(&nap->mu); | 731 NaClXMutexLock(&nap->mu); |
| 732 NaClLog(3, " waiting for exit status\n"); | 732 NaClLog(3, " waiting for exit status\n"); |
| 733 while (nap->running) { | 733 while (nap->running) { |
| 734 NaClCondVarWait(&nap->cv, &nap->mu); | 734 NaClXCondVarWait(&nap->cv, &nap->mu); |
| 735 NaClLog(3, " wakeup, nap->running %d, nap->exit_status %d\n", | 735 NaClLog(3, " wakeup, nap->running %d, nap->exit_status %d\n", |
| 736 nap->running, nap->exit_status); | 736 nap->running, nap->exit_status); |
| 737 } | 737 } |
| 738 NaClXMutexUnlock(&nap->mu); | 738 NaClXMutexUnlock(&nap->mu); |
| 739 /* | 739 /* |
| 740 * Some thread invoked the exit (exit_group) syscall. | 740 * Some thread invoked the exit (exit_group) syscall. |
| 741 */ | 741 */ |
| 742 | 742 |
| 743 if (NULL != nap->debug_stub_callbacks) { | 743 if (NULL != nap->debug_stub_callbacks) { |
| 744 nap->debug_stub_callbacks->process_exit_hook(nap->exit_status); | 744 nap->debug_stub_callbacks->process_exit_hook(nap->exit_status); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 782 sys_tdb, | 782 sys_tdb, |
| 783 tdb_size)) { | 783 tdb_size)) { |
| 784 NaClLog(LOG_WARNING, | 784 NaClLog(LOG_WARNING, |
| 785 ("NaClCreateAdditionalThread: could not allocate thread index." | 785 ("NaClCreateAdditionalThread: could not allocate thread index." |
| 786 " Returning EAGAIN per POSIX specs.\n")); | 786 " Returning EAGAIN per POSIX specs.\n")); |
| 787 free(natp); | 787 free(natp); |
| 788 return -NACL_ABI_EAGAIN; | 788 return -NACL_ABI_EAGAIN; |
| 789 } | 789 } |
| 790 return 0; | 790 return 0; |
| 791 } | 791 } |
| OLD | NEW |