diff options
| author | unknown <Eric@.(none)> | 2011-08-08 13:38:20 -0700 |
|---|---|---|
| committer | Eric Holk <eholk@mozilla.com> | 2011-08-08 16:55:38 -0700 |
| commit | 44bef5f2cb175769155d92ec65bd6b16e6708a1e (patch) | |
| tree | d7524b51e2af0cb191cd93cda3f282ac4ac8f4c6 /src/rt/rust_kernel.h | |
| parent | f4f057ced1f4152575571a6e5116e1ad5bb38beb (diff) | |
| download | rust-44bef5f2cb175769155d92ec65bd6b16e6708a1e.tar.gz rust-44bef5f2cb175769155d92ec65bd6b16e6708a1e.zip | |
Introduced task handles.
This is the new way to refer to tasks in rust-land. Currently all they do is serve as a key to look up the old rust_task structure. Ideally they won't be ref counted, but baby steps.
Diffstat (limited to 'src/rt/rust_kernel.h')
| -rw-r--r-- | src/rt/rust_kernel.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/rt/rust_kernel.h b/src/rt/rust_kernel.h index 45624765a8e..ff5b100445e 100644 --- a/src/rt/rust_kernel.h +++ b/src/rt/rust_kernel.h @@ -26,8 +26,10 @@ private: void create_schedulers(); void destroy_schedulers(); -public: + rust_task_id max_id; + hash_map<rust_task_id, rust_task *> task_table; +public: const size_t num_threads; int rval; @@ -56,7 +58,9 @@ public: void win32_require(LPCTSTR fn, BOOL ok); #endif - rust_task *create_task(rust_task *spawner, const char *name); + rust_task_id create_task(rust_task *spawner, const char *name); + rust_task *get_task_by_id(rust_task_id id); + void release_task_id(rust_task_id tid); }; #endif /* RUST_KERNEL_H */ |
