[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
Tue Oct 17 06:57:07 PDT 2017


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

Solve the problem using pthread_atfork().

This way the locks are properly taken before forking and released in both child
and parent processes. This behavior is encapsulated within the Log class and is
completely transparent to all fork users (but it requires a tiny bit of
system-specific code).


https://reviews.llvm.org/D38938

Files:
  include/lldb/Utility/Log.h
  include/lldb/Utility/Logging.h
  source/Initialization/SystemInitializerCommon.cpp
  source/Utility/Log.cpp
  source/Utility/Logging.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38938.119315.patch
Type: text/x-patch
Size: 2933 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20171017/d4513edf/attachment-0001.bin>


More information about the lldb-commits mailing list