From b278d675a231fdfe825c72e499d59e8a3d07ffaa Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Wed, 14 Mar 2012 17:24:19 -0700 Subject: rt: Look up ports through a single port table Instead of a two-level lookup, just use one big table --- src/rt/rust_kernel.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/rt/rust_kernel.h') diff --git a/src/rt/rust_kernel.h b/src/rt/rust_kernel.h index 626e73f63d0..26938ec565b 100644 --- a/src/rt/rust_kernel.h +++ b/src/rt/rust_kernel.h @@ -30,6 +30,12 @@ private: rust_task_id max_task_id; hash_map task_table; + // Protects max_port_id and port_table + lock_and_signal port_lock; + // The next port id + rust_task_id max_port_id; + hash_map port_table; + lock_and_signal rval_lock; int rval; @@ -73,6 +79,10 @@ public: rust_task *get_task_by_id(rust_task_id id); void release_task_id(rust_task_id tid); + rust_port_id register_port(rust_port *port); + rust_port *get_port_by_id(rust_port_id id); + void release_port_id(rust_port_id tid); + void set_exit_status(int code); }; -- cgit 1.4.1-3-g733a5