about summary refs log tree commit diff
path: root/src/rt
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2012-03-01 21:41:11 -0800
committerBrian Anderson <banderson@mozilla.com>2012-03-01 21:41:11 -0800
commit96f565492da446c4e77b84d937ceccd31337f0ac (patch)
tree87eeac174613f5dc1763bbed329c72749230143a /src/rt
parentb6c57dbba2f5c5822fc4ee4254e91b36c70060f9 (diff)
downloadrust-96f565492da446c4e77b84d937ceccd31337f0ac.tar.gz
rust-96f565492da446c4e77b84d937ceccd31337f0ac.zip
rt: Make fields of rust_task_thread private where possible
Diffstat (limited to 'src/rt')
-rw-r--r--src/rt/rust_task_thread.cpp18
-rw-r--r--src/rt/rust_task_thread.h57
2 files changed, 36 insertions, 39 deletions
diff --git a/src/rt/rust_task_thread.cpp b/src/rt/rust_task_thread.cpp
index 605b15e6ffa..39d9f283645 100644
--- a/src/rt/rust_task_thread.cpp
+++ b/src/rt/rust_task_thread.cpp
@@ -23,22 +23,22 @@ rust_task_thread::rust_task_thread(rust_scheduler *sched,
                                    int id) :
     rust_thread(SCHED_STACK_SIZE),
     _log(srv, this),
-    log_lvl(log_debug),
+    cache(this),
+    id(id),
+    should_exit(false),
+    cached_c_stack(NULL),
+    kernel(sched->kernel),
+    sched(sched),
     srv(srv),
-    // TODO: calculate a per scheduler name.
-    name("main"),
     newborn_tasks(this, "newborn"),
     running_tasks(this, "running"),
     blocked_tasks(this, "blocked"),
     dead_tasks(this, "dead"),
-    cache(this),
-    kernel(sched->kernel),
-    sched(sched),
-    id(id),
+    log_lvl(log_debug),
     min_stack_size(kernel->env->min_stack_size),
     env(kernel->env),
-    should_exit(false),
-    cached_c_stack(NULL)
+    // TODO: calculate a per scheduler name.
+    name("main")
 {
     LOGPTR(this, "new dom", (uintptr_t)this);
     isaac_init(kernel, &rctx);
diff --git a/src/rt/rust_task_thread.h b/src/rt/rust_task_thread.h
index c4ca4b46389..49da2eeeaf5 100644
--- a/src/rt/rust_task_thread.h
+++ b/src/rt/rust_task_thread.h
@@ -45,39 +45,14 @@ public:
 struct rust_task_thread : public kernel_owned<rust_task_thread>,
                         rust_thread
 {
+private:
 
     // Fields known only by the runtime:
     rust_log _log;
 
-    // NB: this is used to filter *runtime-originating* debug
-    // logging, on a per-scheduler basis. It's not likely what
-    // you want to expose to the user in terms of per-task
-    // or per-module logging control. By default all schedulers
-    // are set to debug-level logging here, and filtered by
-    // runtime category using the pseudo-modules ::rt::foo.
-    uint32_t log_lvl;
-
-    rust_srv *srv;
-    const char *const name;
-
-    rust_task_list newborn_tasks;
-    rust_task_list running_tasks;
-    rust_task_list blocked_tasks;
-    rust_task_list dead_tasks;
-
     rust_crate_cache cache;
-
-    randctx rctx;
-
-    rust_kernel *kernel;
-    rust_scheduler *sched;
-    int32_t list_index;
-
     const int id;
 
-    lock_and_signal lock;
-    size_t min_stack_size;
-
 #ifndef __WIN32__
     pthread_attr_t attr;
     static pthread_key_t task_key;
@@ -86,14 +61,10 @@ struct rust_task_thread : public kernel_owned<rust_task_thread>,
 #endif
 
     static bool tls_initialized;
-
-    rust_env *env;
     context c_context;
 
     bool should_exit;
 
-private:
-
     stk_seg *cached_c_stack;
     stk_seg *extra_c_stack;
 
@@ -101,6 +72,32 @@ private:
     void unprepare_c_stack();
 
 public:
+    rust_kernel *kernel;
+    rust_scheduler *sched;
+    rust_srv *srv;
+
+    lock_and_signal lock;
+
+    rust_task_list newborn_tasks;
+    rust_task_list running_tasks;
+    rust_task_list blocked_tasks;
+    rust_task_list dead_tasks;
+
+    // NB: this is used to filter *runtime-originating* debug
+    // logging, on a per-scheduler basis. It's not likely what
+    // you want to expose to the user in terms of per-task
+    // or per-module logging control. By default all schedulers
+    // are set to debug-level logging here, and filtered by
+    // runtime category using the pseudo-modules ::rt::foo.
+    uint32_t log_lvl;
+
+    size_t min_stack_size;
+    rust_env *env;
+
+    randctx rctx;
+
+    int32_t list_index;
+    const char *const name;
 
     // Only a pointer to 'name' is kept, so it must live as long as this
     // domain.