aboutsummaryrefslogtreecommitdiff
path: root/src/common/compat_threads.h
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.h
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.h')
-rw-r--r--src/common/compat_threads.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/common/compat_threads.h b/src/common/compat_threads.h
index 9070f13e80..245df76178 100644
--- a/src/common/compat_threads.h
+++ b/src/common/compat_threads.h
@@ -46,8 +46,9 @@ typedef struct tor_mutex_t {
tor_mutex_t *tor_mutex_new(void);
+tor_mutex_t *tor_mutex_new_nonreentrant(void);
void tor_mutex_init(tor_mutex_t *m);
-void tor_mutex_init_for_cond(tor_mutex_t *m);
+void tor_mutex_init_nonreentrant(tor_mutex_t *m);
void tor_mutex_acquire(tor_mutex_t *m);
void tor_mutex_release(tor_mutex_t *m);
void tor_mutex_free(tor_mutex_t *m);
@@ -55,6 +56,9 @@ void tor_mutex_uninit(tor_mutex_t *m);
unsigned long tor_get_thread_id(void);
void tor_threads_init(void);
+/** Conditions need nonreentrant mutexes with pthreads. */
+#define tor_mutex_init_for_cond(m) tor_mutex_init_nonreentrant(m)
+
void set_main_thread(void);
int in_main_thread(void);