diff options
| author | Eric Holk <eholk@mozilla.com> | 2011-06-24 16:50:06 -0700 |
|---|---|---|
| committer | Graydon Hoare <graydon@mozilla.com> | 2011-06-28 16:12:33 -0700 |
| commit | f6f945fed5c8d1061d80b444331910df29afa392 (patch) | |
| tree | 1ee8908830878e916d26cbae145b00771d5c9c9d /src/rt/rust_kernel.h | |
| parent | c6d83248301b4aed366b9bef682d200381324c01 (diff) | |
| download | rust-f6f945fed5c8d1061d80b444331910df29afa392.tar.gz rust-f6f945fed5c8d1061d80b444331910df29afa392.zip | |
Moved thread management to rust_kernel.
Diffstat (limited to 'src/rt/rust_kernel.h')
| -rw-r--r-- | src/rt/rust_kernel.h | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/rt/rust_kernel.h b/src/rt/rust_kernel.h index 70495d029bc..ee5cf99ef5d 100644 --- a/src/rt/rust_kernel.h +++ b/src/rt/rust_kernel.h @@ -34,6 +34,9 @@ public: } }; +class rust_task_thread; + + /** * A global object shared by all thread domains. Most of the data structures * in this class are synchronized since they are accessed from multiple @@ -44,8 +47,6 @@ class rust_kernel : public rust_thread { rust_log _log; rust_srv *_srv; - rust_dom *dom; - /** * Task proxy objects are kernel owned handles to Rust objects. */ @@ -69,7 +70,11 @@ class rust_kernel : public rust_thread { rust_dom *create_domain(const char *name); void destroy_domain(); + array_list<rust_task_thread *> threads; + public: + rust_dom *dom; + lock_and_signal scheduler_lock; /** * Message queues are kernel objects and are associated with domains. @@ -105,7 +110,10 @@ public: void *malloc(size_t size); void free(void *mem); + // TODO: this should go away inline rust_dom *get_domain() const { return dom; } + + int start_task_threads(int num_threads); }; inline void *operator new(size_t size, rust_kernel *kernel) { @@ -116,4 +124,15 @@ inline void *operator new(size_t size, rust_kernel &kernel) { return kernel.malloc(size); } + +class rust_task_thread : public rust_thread { + int id; + rust_kernel *owner; + +public: + rust_task_thread(int id, rust_kernel *owner); + + virtual void run(); +}; + #endif /* RUST_KERNEL_H */ |
