(comments only) Mention unsafe TLS destructor use (#3039)
This commit is contained in:
parent
3c731df890
commit
73ca5603bd
1 changed files with 7 additions and 2 deletions
|
@ -945,8 +945,13 @@ fn spawn_raw(opts: task_opts, +f: fn~()) {
|
||||||
* task-local data slot (and use class destructors, not code inside the
|
* task-local data slot (and use class destructors, not code inside the
|
||||||
* function, if specific teardown is needed). DO NOT use multiple
|
* function, if specific teardown is needed). DO NOT use multiple
|
||||||
* instantiations of a single polymorphic function to index data of different
|
* instantiations of a single polymorphic function to index data of different
|
||||||
* types; arbitrary type coercion is possible this way. The interface is safe
|
* types; arbitrary type coercion is possible this way.
|
||||||
* as long as all key functions are monomorphic.
|
*
|
||||||
|
* One other exception is that this global state can be used in a destructor
|
||||||
|
* context to create a circular @-box reference, which will crash during task
|
||||||
|
* failure (see issue #3039).
|
||||||
|
*
|
||||||
|
* These two cases aside, the interface is safe.
|
||||||
*/
|
*/
|
||||||
type local_data_key<T: owned> = fn@(+@T);
|
type local_data_key<T: owned> = fn@(+@T);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue