From 65016304d23503e230e8b097b5cdc1e4897b9b57 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Mon, 23 Sep 2013 01:15:30 -0400 Subject: Add tor_cond_init/uninit --- src/common/compat_threads.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/common/compat_threads.c') diff --git a/src/common/compat_threads.c b/src/common/compat_threads.c index 84a8a21fe2..e0cbf5c1d8 100644 --- a/src/common/compat_threads.c +++ b/src/common/compat_threads.c @@ -24,6 +24,23 @@ tor_mutex_free(tor_mutex_t *m) tor_free(m); } +tor_cond_t * +tor_cond_new(void) +{ + tor_cond_t *cond = tor_malloc(sizeof(tor_cond_t)); + if (tor_cond_init(cond)<0) + tor_free(cond); + return cond; +} +void +tor_cond_free(tor_cond_t *c) +{ + if (!c) + return; + tor_cond_uninit(c); + tor_free(c); +} + /** Identity of the "main" thread */ static unsigned long main_thread_id = -1; -- cgit v1.2.3-54-g00ecf