From 50a5d4825869a40ecddf650181b6c4f75dfc6dd0 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Sun, 12 Apr 2009 00:00:00 +0200 Subject: [UNFINISHED] Fix handling of have_kernel_resources on Mach/Hurd. Further comments by Neal: do you want a reply on the libpthread one inline? the short answer is: yes, that's a bug unfortunately, your fix is not enough the predicate controls two resources: the wakeup port and the thread itself Oh, right, I see. also, there may be a race: set the predicate to free, then kill the thread that's not so good so a proper solution requires a bit more thought I think I wondered about that as well. But isn't there the same problem with Viengoos? it is difficult as cleanly committing suicide is hard :-) could be on viengoos, I don't actually deallocate the thread in pt-thread-halt.c I just call suspend the thread is only deallocated in pt-thread-dealloc.c --- sysdeps/mach/pt-thread-dealloc.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sysdeps/mach/pt-thread-dealloc.c') diff --git a/sysdeps/mach/pt-thread-dealloc.c b/sysdeps/mach/pt-thread-dealloc.c index 55d8c4d..0c4a4fc 100644 --- a/sysdeps/mach/pt-thread-dealloc.c +++ b/sysdeps/mach/pt-thread-dealloc.c @@ -38,4 +38,6 @@ __pthread_thread_dealloc (struct __pthread *thread) assert. */ __mach_port_destroy (__mach_task_self (), thread->wakeupmsg.msgh_remote_port); + + thread->have_kernel_resources = 0; } -- cgit v1.2.3