X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=common%2Ftrace_writer_local.hpp;h=c00818b070c303d9eb1557232c9ac5f840fa7124;hb=8b58e2fc73717437867a3a944dd34c4e917af9e7;hp=7c705801b716de4fb7d56d73a5c1cef63df3476d;hpb=a0e612d13d479d1b0e65d11037060b473c9d722f;p=apitrace diff --git a/common/trace_writer_local.hpp b/common/trace_writer_local.hpp index 7c70580..c00818b 100644 --- a/common/trace_writer_local.hpp +++ b/common/trace_writer_local.hpp @@ -31,6 +31,9 @@ #define _TRACE_WRITER_LOCAL_HPP_ +#include + +#include "os_thread.hpp" #include "trace_writer.hpp" @@ -52,6 +55,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: