aboutsummaryrefslogtreecommitdiffhomepage
path: root/common.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-04-21 20:08:08 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-04-21 20:08:44 -0700
commit0e3eb38f1185078662ee44c3120326cdb88274b4 (patch)
treef16b3222ca8fe4933f988f02e6f1bc314482d756 /common.cpp
parentdc23af6b32d4b89eea9ad904495ac5507b8835cc (diff)
Improved fork reporting
Made autosuggestion work properly for tilde expansion
Diffstat (limited to 'common.cpp')
-rw-r--r--common.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/common.cpp b/common.cpp
index 2124fe67..7ec061aa 100644
--- a/common.cpp
+++ b/common.cpp
@@ -1961,7 +1961,7 @@ void append_path_component(wcstring &path, const wcstring &component)
}
extern "C" {
-__attribute__((noinline)) void debug_thread_error(void) {}
+__attribute__((noinline)) void debug_thread_error(void) { while (1) sleep(9999999); }
}
@@ -2015,11 +2015,11 @@ void assert_is_background_thread(const char *who)
}
}
-void assert_is_locked(void *vmutex, const char *who)
+void assert_is_locked(void *vmutex, const char *who, const char *caller)
{
pthread_mutex_t *mutex = static_cast<pthread_mutex_t*>(vmutex);
if (0 == pthread_mutex_trylock(mutex)) {
- fprintf(stderr, "Warning: %s is not locked when it should be. Break on debug_thread_error to debug.\n", who);
+ fprintf(stderr, "Warning: %s is not locked when it should be in '%s'. Break on debug_thread_error to debug.\n", who, caller);
debug_thread_error();
pthread_mutex_unlock(mutex);
}