From 6be74d17df75714066b36cfa6ae40081526ef477 Mon Sep 17 00:00:00 2001 From: kwolekr Date: Fri, 16 Oct 2015 21:12:30 -0400 Subject: Refactor thread utility interface - Add "thr_" prefix to thread utility functions - Compare threadid_ts in a portable manner, where possible --- src/debug.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/debug.cpp') diff --git a/src/debug.cpp b/src/debug.cpp index 82aa6d519..9f1042646 100644 --- a/src/debug.cpp +++ b/src/debug.cpp @@ -45,7 +45,7 @@ void sanity_check_fn(const char *assertion, const char *file, unsigned int line, const char *function) { errorstream << std::endl << "In thread " << std::hex - << (unsigned long)get_current_thread_id() << ":" << std::endl; + << (unsigned long)thr_get_current_thread_id() << ":" << std::endl; errorstream << file << ":" << line << ": " << function << ": An engine assumption '" << assertion << "' failed." << std::endl; @@ -58,7 +58,7 @@ void fatal_error_fn(const char *msg, const char *file, unsigned int line, const char *function) { errorstream << std::endl << "In thread " << std::hex - << (unsigned long)get_current_thread_id() << ":" << std::endl; + << (unsigned long)thr_get_current_thread_id() << ":" << std::endl; errorstream << file << ":" << line << ": " << function << ": A fatal error occured: " << msg << std::endl; @@ -130,6 +130,13 @@ void DebugStack::print(std::ostream &os, bool everything) os<<"Probably overflown."< g_debug_stacks; Mutex g_debug_stacks_mutex; @@ -158,7 +165,7 @@ void debug_stacks_print() DebugStacker::DebugStacker(const char *text) { - threadid_t threadid = get_current_thread_id(); + threadid_t threadid = thr_get_current_thread_id(); MutexAutoLock lock(g_debug_stacks_mutex); -- cgit v1.2.3