summaryrefslogtreecommitdiff
path: root/src/common/compat_threads.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-09-25 11:41:40 -0400
committerNick Mathewson <nickm@torproject.org>2015-01-14 11:05:56 -0500
commit3868b5d210f8bccbfb88464f62089447cb3330ed (patch)
tree875204c3978e3f2ebd5a3522d1e6abb87b33951d /src/common/compat_threads.c
parent93ad89e9d219d6cea764652a05c236210c7de3fa (diff)
downloadtor-3868b5d210f8bccbfb88464f62089447cb3330ed.tar.gz
tor-3868b5d210f8bccbfb88464f62089447cb3330ed.zip
Rename mutex_for_cond -> mutex_nonreentrant
We'll want to use these for other stuff too.
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)