]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Improve threadlocal documentation
authorNick Mathewson <nickm@torproject.org>
Tue, 18 Aug 2015 12:36:58 +0000 (08:36 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 18 Aug 2015 12:56:24 +0000 (08:56 -0400)
src/common/compat_threads.h

index 9f34054050d9e95e44839e8d9c5f153a2b152334..71562ba3efe537532207f6e2d2050e584d9bc3ff 100644 (file)
@@ -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);