mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 12:49:12 +02:00
* made the test threadsafe :)
This commit is contained in:
parent
4e8a1790e6
commit
1144e7ccce
@ -3,6 +3,8 @@
|
|||||||
{$mode objfpc}
|
{$mode objfpc}
|
||||||
{$threading on}
|
{$threading on}
|
||||||
|
|
||||||
|
uses sysutils;
|
||||||
|
|
||||||
const
|
const
|
||||||
threadcount = 100;
|
threadcount = 100;
|
||||||
stringlen = 10000;
|
stringlen = 10000;
|
||||||
@ -23,7 +25,7 @@ function f(p : pointer) : longint;
|
|||||||
inc(thri);
|
inc(thri);
|
||||||
end;
|
end;
|
||||||
writeln('thread ',longint(p),' finished');
|
writeln('thread ',longint(p),' finished');
|
||||||
inc(finished);
|
InterLockedIncrement(finished);
|
||||||
f:=0;
|
f:=0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user