From: Nick Mathewson Date: Tue, 18 Aug 2015 12:36:58 +0000 (-0400) Subject: Improve threadlocal documentation X-Git-Tag: tor-0.2.7.3-rc~97^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3d9952a3b14e83d265a09de9071dc3609e3a4cc9;p=thirdparty%2Ftor.git Improve threadlocal documentation --- 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 * value. + * + * 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);