aboutsummaryrefslogtreecommitdiff
path: root/src/rt/rust_task.cpp
diff options
context:
space:
mode:
authorMichael Bebenita <[email protected]>2010-09-08 19:26:46 -0700
committerMichael Bebenita <[email protected]>2010-09-08 21:25:16 -0700
commit743ca289b6cec6dafb1d1952646b7ec73c63cf07 (patch)
treee8a53560d89269644c29bbe2246c70f219120ff9 /src/rt/rust_task.cpp
parentTidy up the sync dir, remove dead or mis-designed code in favour of OS primit... (diff)
downloadrust-743ca289b6cec6dafb1d1952646b7ec73c63cf07.tar.xz
rust-743ca289b6cec6dafb1d1952646b7ec73c63cf07.zip
Cache task handles.
Diffstat (limited to 'src/rt/rust_task.cpp')
-rw-r--r--src/rt/rust_task.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp
index 408996f6..97502588 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;
}
//