diff options
| author | Ben Blum <bblum@andrew.cmu.edu> | 2012-06-27 13:07:00 -0400 |
|---|---|---|
| committer | Ben Blum <bblum@andrew.cmu.edu> | 2012-06-28 00:10:03 -0400 |
| commit | 1ba3028d8b7acb0c97859ea438f2beb4ccd364f9 (patch) | |
| tree | 6fa4930844a1c0bd20f27b3347a1a905b81e4eaa /src/rt/rust_builtin.cpp | |
| parent | e56ba156e223e24025a743247610283cca49b30a (diff) | |
| download | rust-1ba3028d8b7acb0c97859ea438f2beb4ccd364f9.tar.gz rust-1ba3028d8b7acb0c97859ea438f2beb4ccd364f9.zip | |
rt: Add task_local_data and related builtin calls (Closes #2680)
Diffstat (limited to 'src/rt/rust_builtin.cpp')
| -rw-r--r-- | src/rt/rust_builtin.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp index 38e387735f9..7ffaccece64 100644 --- a/src/rt/rust_builtin.cpp +++ b/src/rt/rust_builtin.cpp @@ -914,7 +914,19 @@ rust_signal_cond_lock(rust_cond_lock *lock) { } } - +// set/get/atexit task_local_data can run on the rust stack for speed. +extern "C" void * +rust_get_task_local_data(rust_task *task) { + return task->task_local_data; +} +extern "C" void +rust_set_task_local_data(rust_task *task, void *data) { + task->task_local_data = data; +} +extern "C" void +rust_task_local_data_atexit(rust_task *task, void (*cleanup_fn)(void *data)) { + task->task_local_data_cleanup = cleanup_fn; +} // // Local Variables: |
