diff options
| author | Brian Anderson <banderson@mozilla.com> | 2012-02-03 17:26:54 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-02-03 23:48:12 -0800 |
| commit | 12fa90888e56c81088e30edd26d1bc404b3e334d (patch) | |
| tree | dc172057b2c4c78859be010907945cc257ac2946 /src/rt/rust_kernel.h | |
| parent | e7f00b64933b85289921f641b2658f41eeb338ec (diff) | |
| download | rust-12fa90888e56c81088e30edd26d1bc404b3e334d.tar.gz rust-12fa90888e56c81088e30edd26d1bc404b3e334d.zip | |
rt: Clean up the way the kernel tracks tasks
Diffstat (limited to 'src/rt/rust_kernel.h')
| -rw-r--r-- | src/rt/rust_kernel.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/rt/rust_kernel.h b/src/rt/rust_kernel.h index 17eaccdf879..ff892aea303 100644 --- a/src/rt/rust_kernel.h +++ b/src/rt/rust_kernel.h @@ -20,25 +20,29 @@ class rust_kernel { public: rust_srv *srv; private: - lock_and_signal _kernel_lock; rust_scheduler *sched; - rust_task_id max_id; + // Tracks the number of tasks that are being managed by + // schedulers. When this hits 0 we will tell all schedulers + // to exit. + volatile int live_tasks; + // Protects max_task_id and task_table + lock_and_signal task_lock; + rust_task_id max_task_id; hash_map<rust_task_id, rust_task *> task_table; + + lock_and_signal rval_lock; int rval; public: - volatile int live_tasks; struct rust_env *env; rust_kernel(rust_srv *srv, size_t num_threads); - - void exit_schedulers(); + ~rust_kernel(); void log(uint32_t level, char const *fmt, ...); void fatal(char const *fmt, ...); - virtual ~rust_kernel(); void *malloc(size_t size, const char *tag); void *realloc(void *mem, size_t size); |
