aboutsummaryrefslogtreecommitdiff
path: root/src/rt
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
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')
-rw-r--r--src/rt/rust_task.cpp8
-rw-r--r--src/rt/rust_task.h2
2 files changed, 8 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;
}
//
diff --git a/src/rt/rust_task.h b/src/rt/rust_task.h
index 383707f0..7b0cfef7 100644
--- a/src/rt/rust_task.h
+++ b/src/rt/rust_task.h
@@ -46,6 +46,8 @@ rust_task : public maybe_proxy<rust_task>,
rust_alarm alarm;
+ rust_handle<rust_task> *handle;
+
// Only a pointer to 'name' is kept, so it must live as long as this task.
rust_task(rust_dom *dom,
rust_task *spawner,