Browse Source

ensure no static init race condition on lock-to-one-cpu

David Rose 17 years ago
parent
commit
140e1145d2

+ 0 - 7
panda/src/express/config_express.cxx

@@ -58,13 +58,6 @@ ConfigVariableBool keep_temporary_files
           "default) to delete these.  Mainly useful for debugging "
           "default) to delete these.  Mainly useful for debugging "
           "when the process goes wrong."));
           "when the process goes wrong."));
 
 
-ConfigVariableBool lock_to_one_cpu
-("lock-to-one-cpu", false,
- PRC_DESC("Set this to true if you want the entire process to use one "
-          "CPU, even on multi-core and multi-CPU workstations. This is "
-          "mainly a hack to solve a bug in which QueryPerformanceCounter "
-          "returns inconsistent results on multi-core machines. "));
-
 ConfigVariableInt multifile_encryption_iteration_count
 ConfigVariableInt multifile_encryption_iteration_count
 ("multifile-encryption-iteration-count", 0,
 ("multifile-encryption-iteration-count", 0,
  PRC_DESC("This is a special value of encryption-iteration-count used to encrypt "
  PRC_DESC("This is a special value of encryption-iteration-count used to encrypt "

+ 0 - 2
panda/src/express/config_express.h

@@ -61,8 +61,6 @@ extern ConfigVariableInt patchfile_zone_size;
 
 
 extern ConfigVariableBool keep_temporary_files;
 extern ConfigVariableBool keep_temporary_files;
 
 
-extern ConfigVariableBool lock_to_one_cpu;
-
 extern ConfigVariableInt multifile_encryption_iteration_count;
 extern ConfigVariableInt multifile_encryption_iteration_count;
 
 
 extern ConfigVariableBool vfs_case_sensitive;
 extern ConfigVariableBool vfs_case_sensitive;

+ 7 - 0
panda/src/express/trueClock.cxx

@@ -166,6 +166,13 @@ TrueClock() {
   _last_reported_time_scale = 1.0;
   _last_reported_time_scale = 1.0;
   _report_time_scale_time = 0.0;
   _report_time_scale_time = 0.0;
 
 
+  ConfigVariableBool lock_to_one_cpu
+    ("lock-to-one-cpu", false,
+     PRC_DESC("Set this to true if you want the entire process to use one "
+              "CPU, even on multi-core and multi-CPU workstations. This is "
+              "mainly a hack to solve a bug in which QueryPerformanceCounter "
+              "returns inconsistent results on multi-core machines. "));
+
   if (lock_to_one_cpu) {
   if (lock_to_one_cpu) {
     set_cpu_affinity(0x01);
     set_cpu_affinity(0x01);
   }
   }