]> git.cworth.org Git - apitrace/blobdiff - common/trace_writer_local.hpp
Move mutex abstraction to os_thread.hpp.
[apitrace] / common / trace_writer_local.hpp
index 7c705801b716de4fb7d56d73a5c1cef63df3476d..e54142f82b816654679b149306966954b3ac4633 100644 (file)
@@ -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: