aboutsummaryrefslogtreecommitdiff
path: root/src/lib/lock
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-11-06 14:40:20 -0500
committerNick Mathewson <nickm@torproject.org>2019-11-06 14:40:20 -0500
commit9687efb386141e5fc46ab295b32bf2dff1f9845b (patch)
tree78b2ff8497ec3532205b7247e7e2ac1ea7b3f6b3 /src/lib/lock
parentb994397f1af193f841703151af846ac497bbc0f7 (diff)
downloadtor-9687efb386141e5fc46ab295b32bf2dff1f9845b.tar.gz
tor-9687efb386141e5fc46ab295b32bf2dff1f9845b.zip
Add a bunch of doxygen for things in src/lib.
Diffstat (limited to 'src/lib/lock')
-rw-r--r--src/lib/lock/compat_mutex.h5
-rw-r--r--src/lib/lock/compat_mutex_pthreads.c6
2 files changed, 11 insertions, 0 deletions
diff --git a/src/lib/lock/compat_mutex.h b/src/lib/lock/compat_mutex.h
index e0c3d7cb78..6fd4c1eb08 100644
--- a/src/lib/lock/compat_mutex.h
+++ b/src/lib/lock/compat_mutex.h
@@ -58,6 +58,11 @@ void tor_mutex_init_nonrecursive(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);
+/**
+ * @copydoc tor_mutex_free_
+ *
+ * Additionally, set the pointer <b>m</b> to NULL.
+ **/
#define tor_mutex_free(m) FREE_AND_NULL(tor_mutex_t, tor_mutex_free_, (m))
void tor_mutex_uninit(tor_mutex_t *m);
diff --git a/src/lib/lock/compat_mutex_pthreads.c b/src/lib/lock/compat_mutex_pthreads.c
index f82ad9f0e8..a7f5986ecb 100644
--- a/src/lib/lock/compat_mutex_pthreads.c
+++ b/src/lib/lock/compat_mutex_pthreads.c
@@ -17,8 +17,14 @@
* "recursive" mutexes (i.e., once we can re-lock if we're already holding
* them.) */
static pthread_mutexattr_t attr_recursive;
+/**
+ * True iff <b>attr_recursive</b> has been initialized.
+ **/
static int attr_initialized = 0;
+/**
+ * Initialize the locking module, if it is not already initialized.
+ **/
void
tor_locking_init(void)
{