diff options
Diffstat (limited to 'src/common/compat_threads.c')
-rw-r--r-- | src/common/compat_threads.c | 17 |
1 files changed, 17 insertions, 0 deletions
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; |