summaryrefslogtreecommitdiff
path: root/src/common/compat_threads.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/compat_threads.c')
-rw-r--r--src/common/compat_threads.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/common/compat_threads.c b/src/common/compat_threads.c
index 024c627cf1..f2a516a4a3 100644
--- a/src/common/compat_threads.c
+++ b/src/common/compat_threads.c
@@ -30,6 +30,15 @@ tor_mutex_new(void)
tor_mutex_init(m);
return m;
}
+/** Return a newly allocated, ready-for-use mutex. This one might be
+ * non-reentrant, if that's faster. */
+tor_mutex_t *
+tor_mutex_new_nonreentrant(void)
+{
+ tor_mutex_t *m = tor_malloc_zero(sizeof(tor_mutex_t));
+ tor_mutex_init_nonreentrant(m);
+ return m;
+}
/** Release all storage and system resources held by <b>m</b>. */
void
tor_mutex_free(tor_mutex_t *m)