+ disable interrupts as a form of 'locking' in InterLockedDecrement and

InterLockedIncrement

git-svn-id: trunk@27401 -
This commit is contained in:
nickysn 2014-03-30 22:41:48 +00:00
parent 2dd9a36bdc
commit 14ecc118ec

View File

@ -213,10 +213,13 @@ function InterLockedDecrement (var Target: longint) : longint;nostackframe;assem
asm
mov si, sp
mov bx, ss:[si + 2 + extra_param_offset] // Target
pushf
cli
sub word [bx], 1
sbb word [bx+2], 0
mov ax, [bx]
mov dx, [bx+2]
popf
end;
{TODO: fix, use smallint?}
@ -224,10 +227,13 @@ function InterLockedIncrement (var Target: longint) : longint;nostackframe;assem
asm
mov si, sp
mov bx, ss:[si + 2 + extra_param_offset] // Target
pushf
cli
add word [bx], 1
adc word [bx+2], 0
mov ax, [bx]
mov dx, [bx+2]
popf
end;
{TODO: fix, use smallint?}