Hurd: make sigstates hold a reference on thread ports
authorRichard Braun <rbraun@sceen.net>
Wed, 1 May 2019 17:24:19 +0000 (18:24 +0100)
committerAurelien Jarno <aurel32@debian.org>
Wed, 1 May 2019 17:24:19 +0000 (18:24 +0100)
commite160e9fcea6a3f07ea3c02aa230c279d04ad7562
tree8770d49f9e94f021217669c0dfabe3253dce925b
parent48865544f6f84ff4212adafa0668edcc2e974e14
Hurd: make sigstates hold a reference on thread ports

This change is required in order to correctly release per-thread
resources. Directly reusing the threading library reference isn't
possible since the sigstate is also used early in the main thread,
before threading is initialized.

* hurd/hurd/signal.h (_hurd_self_sigstate): Drop thread reference after
calling _hurd_thread_sigstate.
(_hurd_critical_section_lock): Likewise.
* hurd/hurdsig.c (_hurd_thread_sigstate): Add a reference on the thread.
(_hurd_sigstate_delete): Drop thread reference.

Gbp-Pq: Topic hurd-i386
Gbp-Pq: Name tg-sigstate_thread_reference.diff
hurd/hurd/signal.h
hurd/hurdsig.c