Fix: fd tracker: provide async-signal-safety for close wrapper
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 4 Oct 2019 19:04:13 +0000 (15:04 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 7 Oct 2019 16:02:48 +0000 (12:02 -0400)
commitb3ed6b55db13c4569427a83001890518ddfb0537
treefa5904b77eca4c55ee26505217516beb64368929
parent8385a01eb3615dbef6361a3f086243f4e6e7c0b4
Fix: fd tracker: provide async-signal-safety for close wrapper

close(3) is part of the async-signal-safe functions. Therefore, it is
expected that the close wrapper provided by liblttng-ust-fd-tracker
behaves in a async-signal-safe way.

Use a similar strategy as ust_lock() does: disable signals when taking
and releasing the lock, and keep track of nesting with a TLS variable.
This ensures signals are restored to their original state when close(3)
ends up being invoked.

Fixes: #1199
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
liblttng-ust-comm/lttng-ust-fd-tracker.c
This page took 0.025875 seconds and 4 git commands to generate.