浏览代码

Improve threadlocal documentation

Nick Mathewson 8 年之前
父节点
当前提交
3d9952a3b1
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      src/common/compat_threads.h

+ 6 - 0
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);