diff options
| author | Michael Bebenita <mbebenita@mozilla.com> | 2010-09-08 19:26:46 -0700 |
|---|---|---|
| committer | Michael Bebenita <mbebenita@mozilla.com> | 2010-09-08 21:25:16 -0700 |
| commit | 743ca289b6cec6dafb1d1952646b7ec73c63cf07 (patch) | |
| tree | e8a53560d89269644c29bbe2246c70f219120ff9 /src/rt/rust_task.cpp | |
| parent | 616b7afb724a32df41eebfaf95402d008c60b411 (diff) | |
| download | rust-743ca289b6cec6dafb1d1952646b7ec73c63cf07.tar.gz rust-743ca289b6cec6dafb1d1952646b7ec73c63cf07.zip | |
Cache task handles.
Diffstat (limited to 'src/rt/rust_task.cpp')
| -rw-r--r-- | src/rt/rust_task.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp index 408996f69db..9750258862d 100644 --- a/src/rt/rust_task.cpp +++ b/src/rt/rust_task.cpp @@ -69,7 +69,8 @@ rust_task::rust_task(rust_dom *dom, rust_task *spawner, const char *name) : supervisor(spawner), idx(0), rendezvous_ptr(0), - alarm(this) + alarm(this), + handle(NULL) { dom->logptr("new task", (uintptr_t)this); @@ -633,7 +634,10 @@ rust_task::log(uint32_t type_bits, char const *fmt, ...) { rust_handle<rust_task> * rust_task::get_handle() { - return dom->kernel->get_task_handle(this); + if (handle == NULL) { + handle = dom->kernel->get_task_handle(this); + } + return handle; } // |
