mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 19:29:26 +02:00
+ disable interrupts as a form of 'locking' in InterLockedDecrement and
InterLockedIncrement git-svn-id: trunk@27401 -
This commit is contained in:
parent
2dd9a36bdc
commit
14ecc118ec
@ -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?}
|
||||
|
Loading…
Reference in New Issue
Block a user