From be05086a4b9de42ba7c596905e8980d8713eae49 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sun, 7 Dec 2014 23:05:48 +0100 Subject: Fix pthread_create warning on translator termination This was due to task_terminate not actually properly suspending threads before disable the task port, which was thus preventing pthread_create from being able to create a stack. Thanks Gabriele Giacone for finding out a reproducer of this. * kern/task.h (task_hold_locked): New declaration. * kern/task.c (task_hold): Move the locked part of the code into... (task_hold_locked): ... new function. (task_terminate): Call task_hold_locked just before deactivating the task. Call ipc_task_disable after waiting for threads to actually suspend with task_dowait. --- kern/task.h | 1 + 1 file changed, 1 insertion(+) (limited to 'kern/task.h') diff --git a/kern/task.h b/kern/task.h index 3c10dc0..2a4c28f 100644 --- a/kern/task.h +++ b/kern/task.h @@ -182,6 +182,7 @@ extern void consider_task_collect(void); extern void task_init(void); extern void task_reference(task_t); extern void task_deallocate(task_t); +extern void task_hold_locked(task_t); extern kern_return_t task_hold(task_t); extern kern_return_t task_dowait(task_t, boolean_t); extern kern_return_t task_release(task_t); -- cgit v1.2.3