X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=common%2Ftrace_writer_local.hpp;fp=common%2Ftrace_writer_local.hpp;h=e54142f82b816654679b149306966954b3ac4633;hb=0e47f66f21683a18f34282e07efa85cdac4fe0e0;hp=7c705801b716de4fb7d56d73a5c1cef63df3476d;hpb=a0e612d13d479d1b0e65d11037060b473c9d722f;p=apitrace diff --git a/common/trace_writer_local.hpp b/common/trace_writer_local.hpp index 7c70580..e54142f 100644 --- a/common/trace_writer_local.hpp +++ b/common/trace_writer_local.hpp @@ -31,6 +31,7 @@ #define _TRACE_WRITER_LOCAL_HPP_ +#include "os_thread.hpp" #include "trace_writer.hpp" @@ -52,6 +53,10 @@ namespace trace { */ class LocalWriter : public Writer { protected: + /** + * We need a recursive mutex so that it doesn't dead lock when a segfault happens when the mutex is held. + */ + os::recursive_mutex mutex; int acquired; public: