diff --git a/utils/check_expr.c b/utils/check_expr.c
index 135e9d1e2ff0eadf345fb36547f52f9a5b534d7c..6cd535df25f49212602d73fe6a8b6d79c03c7061 100644
--- a/utils/check_expr.c
+++ b/utils/check_expr.c
@@ -55,6 +55,7 @@ void * attribute_malloc _ast_calloc(size_t num, size_t len, const char *file, in
 }
 #endif
 
+#ifdef DEBUG_THREADS
 #if !defined(LOW_MEMORY)
 #ifdef HAVE_BKTR
 void ast_store_lock_info(enum ast_lock_type type, const char *filename,
@@ -117,6 +118,7 @@ void ast_mark_lock_acquired(void *foo)
     /* not a lot to do in a standalone w/o threading! */
 }
 #endif
+#endif /* DEBUG_THREADS */
 
 
 static int global_lineno = 1;