summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-08-18 08:36:58 -0400
committerNick Mathewson <nickm@torproject.org>2015-08-18 08:56:24 -0400
commit3d9952a3b14e83d265a09de9071dc3609e3a4cc9 (patch)
treebd6168fbd93f13174f6c1835fa8df18575976c74 /src/common
parente8fe77530ad6238dc16781b0032899f3affa778f (diff)
downloadtor-3d9952a3b14e83d265a09de9071dc3609e3a4cc9.tar.gz
tor-3d9952a3b14e83d265a09de9071dc3609e3a4cc9.zip
Improve threadlocal documentation
Diffstat (limited to 'src/common')
-rw-r--r--src/common/compat_threads.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/common/compat_threads.h b/src/common/compat_threads.h
index 9f34054050..71562ba3ef 100644
--- a/src/common/compat_threads.h
+++ b/src/common/compat_threads.h
@@ -133,11 +133,17 @@ int tor_threadlocal_init(tor_threadlocal_t *threadlocal);
void tor_threadlocal_destroy(tor_threadlocal_t *threadlocal);
/**
* Return the current value of a thread-local variable for this thread.
+ *
+ * It's undefined behavior to use this function if the threadlocal hasn't
+ * been initialized, or has been destroyed.
*/
void *tor_threadlocal_get(tor_threadlocal_t *threadlocal);
/**
* Change the current value of a thread-local variable for this thread to
* <b>value</b>.
+ *
+ * It's undefined behavior to use this function if the threadlocal hasn't
+ * been initialized, or has been destroyed.
*/
void tor_threadlocal_set(tor_threadlocal_t *threadlocal, void *value);