This commit is contained in:
Pavel 2022-11-10 15:31:42 +03:00
parent 6226cceb19
commit 99393e0e19
2 changed files with 28 additions and 24 deletions

View File

@ -333,21 +333,23 @@ begin
Result:=0; Result:=0;
repeat repeat
if (node.ret<>1) then //is signaled
begin
if (pResultPat<>nil) then
begin
pResultPat^:=node.ResultPat;
end;
Result:=node.ret;
Break;
end else
if (Result=EINTR) then
begin
Break;
end;
spin_lock(ef^.lock_list); spin_lock(ef^.lock_list);
if (node.ret<>1) then //is signaled
begin
if (pResultPat<>nil) then
begin
pResultPat^:=node.ResultPat;
end;
Result:=node.ret;
spin_unlock(ef^.lock_list);
Break;
end else
if (Result=EINTR) then
begin
spin_unlock(ef^.lock_list);
Break;
end;
if _test_and_set(ef,bitPattern,waitMode,pResultPat) then if _test_and_set(ef,bitPattern,waitMode,pResultPat) then
begin begin
store_seq_cst(node.ret,0); store_seq_cst(node.ret,0);

View File

@ -418,17 +418,19 @@ begin
repeat repeat
if (node.ret<>1) then //is signaled
begin
Result:=node.ret;
Break;
end else
if (Result=EINTR) then
begin
Break;
end;
spin_lock(sv^.vlock); spin_lock(sv^.vlock);
if (node.ret<>1) then //is signaled
begin
Result:=node.ret;
spin_unlock(sv^.vlock);
Break;
end else
if (Result=EINTR) then
begin
spin_unlock(sv^.vlock);
Break;
end;
if (sv^.value>=count) then if (sv^.value>=count) then
begin begin
Dec(sv^.value,count); Dec(sv^.value,count);