Merge pull request #1682 from NZJenkins/lockfs_perf
Improve LockFS performance
This commit is contained in:
commit
ec3f97e4f0
|
@ -128,12 +128,12 @@ __declspec(naked) void LockFS()
|
||||||
// Backup Registers
|
// Backup Registers
|
||||||
pushfd
|
pushfd
|
||||||
pushad
|
pushad
|
||||||
|
jmp entry
|
||||||
|
|
||||||
// Spin until we can aquire the lock
|
// Spin until we can aquire the lock
|
||||||
spinlock :
|
spinlock :
|
||||||
call SwitchToThread // Give other threads chance to run, prevents hogging entire timeslice waiting for spinlock
|
call SwitchToThread // Give other threads a chance to run if we couldn't get the lock
|
||||||
// We do this here loop because SwitchToThread will overwrite eax, so it cannot go below
|
entry:
|
||||||
// It's not worth wasting the extra cycles of pushing/popping eax to the stack around this call
|
|
||||||
mov eax, 1
|
mov eax, 1
|
||||||
xchg eax, fs_lock
|
xchg eax, fs_lock
|
||||||
test eax, eax
|
test eax, eax
|
||||||
|
|
Loading…
Reference in New Issue