aboutsummaryrefslogtreecommitdiffhomepage
path: root/common.h
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-02-24 12:13:35 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-02-24 12:19:31 -0800
commita515db4aea51a032b06eb463fcc5a5b70066a18c (patch)
tree68774c3b9afbdadfbdde6ecdf8934b3099cdb331 /common.h
parent90e979d0d9a94601fc9a0c1e5ad785ede1e92381 (diff)
Some work to allow completions to be evaluated off of the main thread
Diffstat (limited to 'common.h')
-rw-r--r--common.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/common.h b/common.h
index 9e74dc30..8fb950fe 100644
--- a/common.h
+++ b/common.h
@@ -258,6 +258,9 @@ void assert_is_background_thread(const char *who);
#define ASSERT_IS_BACKGROUND_THREAD_TRAMPOLINE(x) assert_is_background_thread(x)
#define ASSERT_IS_BACKGROUND_THREAD() ASSERT_IS_BACKGROUND_THREAD_TRAMPOLINE(__FUNCTION__)
+/* Useful macro for asserting that a lock is locked. This doesn't check whether this thread locked it, which it would be nice if it did, but here it is anyways. */
+void assert_is_locked(void *mutex, const char *who);
+#define ASSERT_IS_LOCKED(x) assert_is_locked((void *)(&x), #x)
/**
Converts the wide character string \c in into it's narrow