Hurd: make sigstates hold a reference on thread ports
authorRichard Braun <rbraun@sceen.net>
Tue, 21 Nov 2017 23:14:20 +0000 (23:14 +0000)
committerAurelien Jarno <aurel32@debian.org>
Tue, 21 Nov 2017 23:14:20 +0000 (23:14 +0000)
commitfae033085e5797c2d0500cc7eed71e1ef7a1bf2e
tree31cbca33474f0e3bca1b821b60fd07fe90b730be
parent0bd2f06bef267130677dd5630613c02c1d1229e4
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