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

This commit is contained in:
David Rose 2008-08-17 06:11:36 +00:00
parent 17f898413e
commit 140e1145d2
3 changed files with 7 additions and 9 deletions

View File

@ -58,13 +58,6 @@ ConfigVariableBool keep_temporary_files
"default) to delete these. Mainly useful for debugging "
"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
("multifile-encryption-iteration-count", 0,
PRC_DESC("This is a special value of encryption-iteration-count used to encrypt "

View File

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

View File

@ -166,6 +166,13 @@ TrueClock() {
_last_reported_time_scale = 1.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) {
set_cpu_affinity(0x01);
}