| OLD | NEW |
| 1 #define _GNU_SOURCE | 1 #define _GNU_SOURCE |
| 2 #include <string.h> | 2 #include <string.h> |
| 3 #include "pthread_impl.h" | 3 #include "pthread_impl.h" |
| 4 #include "syscall.h" | 4 #include "syscall.h" |
| 5 #include "libc.h" | 5 #include "libc.h" |
| 6 | 6 |
| 7 __attribute__((__visibility__("hidden"))) | 7 __attribute__((__visibility__("hidden"))) |
| 8 long __cancel(), __syscall_cp_asm(), __syscall_cp_c(); | 8 long __cancel(), __syscall_cp_asm(), __syscall_cp_c(); |
| 9 | 9 |
| 10 long __cancel() | 10 long __cancel() |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 } | 85 } |
| 86 | 86 |
| 87 int pthread_cancel(pthread_t t) | 87 int pthread_cancel(pthread_t t) |
| 88 { | 88 { |
| 89 static int init; | 89 static int init; |
| 90 if (!init) { | 90 if (!init) { |
| 91 init_cancellation(); | 91 init_cancellation(); |
| 92 init = 1; | 92 init = 1; |
| 93 } | 93 } |
| 94 a_store(&t->cancel, 1); | 94 a_store(&t->cancel, 1); |
| 95 if (t == pthread_self() && !t->cancelasync) return 0; |
| 95 return pthread_kill(t, SIGCANCEL); | 96 return pthread_kill(t, SIGCANCEL); |
| 96 } | 97 } |
| OLD | NEW |