Hurd: make sigstates hold a reference on thread ports
authorRichard Braun <rbraun@sceen.net>
Sun, 4 Dec 2016 21:49:53 +0000 (21:49 +0000)
committerSamuel Thibault <sthibault@debian.org>
Sun, 4 Dec 2016 21:49:53 +0000 (21:49 +0000)
commit40fb27e5946c35c8961d34f8f0dcbd932687608e
tree20f3e6c863ca7a0d31dbaf57fa7b100d10d1590e
parent38643e90510dd37109d29ed41449a3e1c0703e48
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