diff options
| author | Ben Blum <bblum@andrew.cmu.edu> | 2012-07-26 21:04:34 -0400 |
|---|---|---|
| committer | Ben Blum <bblum@andrew.cmu.edu> | 2012-07-26 21:20:02 -0400 |
| commit | 73ca5603bd1bf57e1734ff859299d7b10626a644 (patch) | |
| tree | 995bdb572aea0662977a793b3da1887ce22a5717 /src/libcore | |
| parent | 3c731df890e4354fbd30a7a4a21f0352ac6f3102 (diff) | |
| download | rust-73ca5603bd1bf57e1734ff859299d7b10626a644.tar.gz rust-73ca5603bd1bf57e1734ff859299d7b10626a644.zip | |
(comments only) Mention unsafe TLS destructor use (#3039)
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/task.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/libcore/task.rs b/src/libcore/task.rs index 04ff9058b37..158e16fa898 100644 --- a/src/libcore/task.rs +++ b/src/libcore/task.rs @@ -945,8 +945,13 @@ fn spawn_raw(opts: task_opts, +f: fn~()) { * task-local data slot (and use class destructors, not code inside the * function, if specific teardown is needed). DO NOT use multiple * instantiations of a single polymorphic function to index data of different - * types; arbitrary type coercion is possible this way. The interface is safe - * as long as all key functions are monomorphic. + * types; arbitrary type coercion is possible this way. + * + * 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); |
