[kernel] Use PAUSE in spinwait

Using PAUSE in a tight loop allows other logical cores on the same
physical core to make use of more of the core's resources.
This commit is contained in:
Justin C. Miller
2021-02-07 23:52:06 -08:00
parent 5e7792c11f
commit 31289436f5

View File

@@ -17,6 +17,6 @@ void
clock::spinwait(uint64_t us) const
{
uint64_t when = value() + us;
while (value() < when);
while (value() < when) asm ("pause");
}