compat send no SIGPIPE: multithread-safe
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 15 Oct 2015 16:07:46 +0000 (12:07 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 15 Oct 2015 18:17:00 +0000 (14:17 -0400)
commite9466c8f8245a538c30dcf8221465352c0234e3c
tree70398f5f977965335a171e3ccf37c2734cf42dad
parent12a08de42038eca02095b93b74cb9e2313986876
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.025356 seconds and 4 git commands to generate.