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