Like hurd_thread_cancel does.
* sysdeps/mach/hurd/htl/pt-docancel.c: Include <hurd/signal.h>
(__pthread_do_cancel): Lock target thread's critical_section_lock and ss
lock around thread mangling.
<https://www.gnu.org/licenses/>. */
#include <pthread.h>
+#include <hurd/signal.h>
#include <pt-internal.h>
#include <pthreadP.h>
else
{
error_t err;
+ struct hurd_sigstate *ss = _hurd_thread_sigstate (p->kernel_thread);
+
+ __spin_lock (&ss->critical_section_lock);
+ __spin_lock (&ss->lock);
err = __thread_suspend (p->kernel_thread);
assert_perror (err);
+ __spin_unlock (&ss->lock);
+
err = __thread_abort (p->kernel_thread);
assert_perror (err);
err = __thread_resume (p->kernel_thread);
assert_perror (err);
+
+ _hurd_critical_section_unlock (ss);
}
return 0;