Add some possibly-useful markers for debugging threads from coredumps.
[dcpomatic.git] / src / lib / util.cc
index d3511e8c7e34e0b1c5f5744147b18d83fb944837..65bfd4534b4b9ae51be736e258275e306e5d341c 100644 (file)
@@ -1176,3 +1176,20 @@ to_upper (string s)
        return s;
 }
 
+
+/* Set to 1 to print the IDs of some of our threads to stdout on creation */
+#define DCPOMATIC_DEBUG_THREADS 0
+
+#if DCPOMATIC_DEBUG_THREADS
+void
+start_of_thread (string name)
+{
+       std::cout << "THREAD:" << name << ":" << std::hex << pthread_self() << "\n";
+}
+#else
+void
+start_of_thread (string)
+{
+
+}
+#endif