compat send no SIGPIPE: multithread-safe
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 15 Oct 2015 16:07:46 +0000 (12:07 -0400)
committerMichael Jeanson <mjeanson@efficios.com>
Fri, 16 Oct 2015 19:40:34 +0000 (15:40 -0400)
commitf73291f2dcea06f87920c647135c5079ab4dfd4a
tree7f1013488b8b3344f598ff6d2ecea3f5c4f81703
parentbb587d3bb4ffe846199ef4783f16e03248872685
compat send no SIGPIPE: multithread-safe

The current implementation of the no-SIGPIPE send in the compatibility
layer has side-effects on multithreaded processes due to use of
sigaction(). Although multithread-safety is not strictly needed since
Babeltrace is single-threaded for now, there is no reason to keep this
limitation deeply rooted in a compatibility layer.

Use the multithreaded-safe algorithm to catch SIGPIPE implemented in
LTTng-UST for the write() system call for platforms that do not have
MSG_NOSIGNAL. It was originally implented in LTTng-UST as part of the
ring buffer wakeup. This is a re-implementation of this same algorithm
under MIT license. It uses signal masks and sigtimedwait.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
include/babeltrace/compat/send.h
This page took 0.026743 seconds and 4 git commands to generate.