Use cpu_spinwait() (i.e., "pause") when spinning on rdtsc during DELAY().

MFC after:	1 week
This commit is contained in:
John Baldwin 2008-01-17 18:59:38 +00:00
parent 6634dbbde4
commit c05655bfda
3 changed files with 3 additions and 0 deletions

View file

@ -286,6 +286,7 @@ DELAY(int n)
start = rdtsc();
end = start + (tsc_freq * n) / 1000000;
do {
cpu_spinwait();
now = rdtsc();
} while (now < end || (now > start && end < start));
sched_unpin();

View file

@ -291,6 +291,7 @@ DELAY(int n)
start = rdtsc();
end = start + (tsc_freq * n) / 1000000;
do {
cpu_spinwait();
now = rdtsc();
} while (now < end || (now > start && end < start));
sched_unpin();

View file

@ -291,6 +291,7 @@ DELAY(int n)
start = rdtsc();
end = start + (tsc_freq * n) / 1000000;
do {
cpu_spinwait();
now = rdtsc();
} while (now < end || (now > start && end < start));
sched_unpin();