Fix issue #130 due to fastlock timeout reduction

Former-commit-id: dbef17c2e16f115733242721e9b5a43f01e7a554
This commit is contained in:
John Sully 2020-01-01 11:52:00 -05:00
parent 55cddbe82f
commit ad0cb8da40
2 changed files with 2 additions and 2 deletions

View File

@ -293,7 +293,7 @@ extern "C" void fastlock_lock(struct fastlock *lock)
#elif defined(__arm__)
__asm__ __volatile__ ("yield");
#endif
if ((++cloops % 0x10000) == 0)
if ((++cloops % 0x100000) == 0)
{
fastlock_sleep(lock, tid, ticketT.u, mask);
}

View File

@ -45,7 +45,7 @@ fastlock_lock:
cmp dx, ax # is our ticket up?
je .LLocked # leave the loop
pause
add ecx, 0x10000 # Have we been waiting a long time? (oflow if we have)
add ecx, 0x1000 # Have we been waiting a long time? (oflow if we have)
# 1000h is set so we overflow on the 1024*1024'th iteration (like the C code)
jnc .LLoop # If so, give up our timeslice to someone who's doing real work
# Like the compiler, you're probably thinking: "Hey! I should take these pushs out of the loop"