30 |
int |
int |
31 |
__pthread_do_cancel (struct __pthread *p) |
__pthread_do_cancel (struct __pthread *p) |
32 |
{ |
{ |
33 |
|
mach_port_t ktid; |
34 |
|
int me; |
35 |
|
|
36 |
assert (p->cancel_pending = 1); |
assert (p->cancel_pending = 1); |
37 |
assert (p->cancel_state == PTHREAD_CANCEL_ENABLE); |
assert (p->cancel_state == PTHREAD_CANCEL_ENABLE); |
38 |
|
|
39 |
if (__mach_thread_self () == p->kernel_thread) |
ktid = __mach_thread_self (); |
40 |
|
me = p->kernel_thread == ktid; |
41 |
|
__mach_port_deallocate (__mach_task_self (), ktid); |
42 |
|
|
43 |
|
if (me) |
44 |
call_exit (); |
call_exit (); |
45 |
else |
else |
46 |
{ |
{ |