Przeglądaj źródła

save thread priority

David Rose 16 lat temu
rodzic
commit
5f271d85c6

+ 3 - 0
panda/src/pipeline/threadSimpleImpl.cxx

@@ -38,6 +38,7 @@ ThreadSimpleImpl(Thread *parent_obj) :
 
 
   _status = S_new;
   _status = S_new;
   _joinable = false;
   _joinable = false;
+  _priority = TP_normal;
   _priority_weight = 1.0;
   _priority_weight = 1.0;
   _run_ticks = 0;
   _run_ticks = 0;
   _start_time = 0.0;
   _start_time = 0.0;
@@ -80,6 +81,7 @@ ThreadSimpleImpl::
 void ThreadSimpleImpl::
 void ThreadSimpleImpl::
 setup_main_thread() {
 setup_main_thread() {
   _status = S_running;
   _status = S_running;
+  _priority = TP_normal;
   _priority_weight = _manager->_simple_thread_normal_weight;
   _priority_weight = _manager->_simple_thread_normal_weight;
 
 
   _manager->set_current_thread(this);
   _manager->set_current_thread(this);
@@ -104,6 +106,7 @@ start(ThreadPriority priority, bool joinable) {
 
 
   _joinable = joinable;
   _joinable = joinable;
   _status = S_running;
   _status = S_running;
+  _priority = priority;
 
 
   switch (priority) {
   switch (priority) {
   case TP_low:
   case TP_low:

+ 1 - 0
panda/src/pipeline/threadSimpleImpl.h

@@ -105,6 +105,7 @@ private:
   Thread *_parent_obj;
   Thread *_parent_obj;
   bool _joinable;
   bool _joinable;
   Status _status;
   Status _status;
+  ThreadPriority _priority;
 
 
   // The relative weight of this thread, relative to other threads, in
   // The relative weight of this thread, relative to other threads, in
   // priority.
   // priority.