summaryrefslogtreecommitdiff
path: root/src/lib/util.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-04-20 12:27:40 +0200
committerCarl Hetherington <cth@carlh.net>2021-04-21 00:52:07 +0200
commitc370c651eba466f5073384de8b304a2625c64b89 (patch)
treed60eb159f3b22141457fdadb332c19ec025f013b /src/lib/util.cc
parentf61acf7791b17d446f8953ca261092d4fb878d37 (diff)
Add some possibly-useful markers for debugging threads from coredumps.
Diffstat (limited to 'src/lib/util.cc')
-rw-r--r--src/lib/util.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/lib/util.cc b/src/lib/util.cc
index d3511e8c7..65bfd4534 100644
--- a/src/lib/util.cc
+++ b/src/lib/util.cc
@@ -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