| OLD | NEW |
| 1 #include <atomic.h> | 1 #include <atomic.h> |
| 2 #include <irt_syscalls.h> | 2 #include <irt_syscalls.h> |
| 3 #include <nptl/pthreadP.h> | 3 #include <nptl/pthreadP.h> |
| 4 #include <unistd.h> | 4 #include <unistd.h> |
| 5 | 5 |
| 6 void __exit_thread (int val) | 6 void __exit_thread (int val) |
| 7 { | 7 { |
| 8 /* We are about to die: make our pd "almost free" and wake up waiter. */ | 8 /* We are about to die: make our pd "almost free" and wake up waiter. */ |
| 9 struct pthread* pd = THREAD_SELF; | 9 struct pthread* pd = THREAD_SELF; |
| 10 int count; |
| 10 pd->tid = -2; | 11 pd->tid = -2; |
| 11 __nacl_futex_wake (&pd->tid, INT_MAX, __FUTEX_BITSET_MATCH_ANY); | 12 __nacl_futex_wake (&pd->tid, INT_MAX, __FUTEX_BITSET_MATCH_ANY, &count); |
| 12 __nacl_irt_thread_exit (&pd->tid); | 13 __nacl_irt_thread_exit (&pd->tid); |
| 13 /* Not reached */ | 14 /* Not reached */ |
| 14 __asm__ ("hlt"); | 15 __asm__ ("hlt"); |
| 15 } | 16 } |
| OLD | NEW |