tor  0.4.0.1-alpha
compat_mutex.c
Go to the documentation of this file.
1 /* Copyright (c) 2003-2004, Roger Dingledine
2  * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
3  * Copyright (c) 2007-2019, The Tor Project, Inc. */
4 /* See LICENSE for licensing information */
5 
12 #include "lib/lock/compat_mutex.h"
13 #include "lib/malloc/malloc.h"
14 
18 {
19  tor_mutex_t *m = tor_malloc_zero(sizeof(tor_mutex_t));
20  tor_mutex_init(m);
21  return m;
22 }
27 {
28  tor_mutex_t *m = tor_malloc_zero(sizeof(tor_mutex_t));
30  return m;
31 }
33 void
35 {
36  if (!m)
37  return;
39  tor_free(m);
40 }
tor_mutex_t * tor_mutex_new_nonrecursive(void)
Definition: compat_mutex.c:26
#define tor_free(p)
Definition: malloc.h:52
void tor_mutex_init_nonrecursive(tor_mutex_t *m)
Headers for util_malloc.c.
void tor_mutex_uninit(tor_mutex_t *m)
void tor_mutex_free_(tor_mutex_t *m)
Definition: compat_mutex.c:34
void tor_mutex_init(tor_mutex_t *m)
Header for compat_mutex.c.
tor_mutex_t * tor_mutex_new(void)
Definition: compat_mutex.c:17