[Lldb-commits] [PATCH] D38938: Logging: provide a way to safely disable logging in a forked process

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Oct 20 14:14:19 PDT 2017

labath updated this revision to Diff 119710.
labath added a comment.

The previous fix had a problem where a more paraniod libc (e.g., android, but I
suspect freebds would do that as well) would detect that the
thread unlocking the mutex is not the same one as the one that locked, and
refused to comply.

The new fix is a combination of the first two solutions: we disable the logging
via custom code after forking, but we still do it via pthread_atfork to avoid
this detail leaking outside the Log implementation. The added benefit is that
forking code does not need to worry about logging at all, as it will be
automatically disabled.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38938.119710.patch
Type: text/x-patch
Size: 3473 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20171020/87c4d757/attachment-0001.bin>

More information about the lldb-commits mailing list