Browse Source

* made the test threadsafe :)

Jonas Maebe 23 years ago
parent
commit
1144e7ccce
1 changed files with 3 additions and 1 deletions
  1. 3 1
      tests/test/tmt1.pp

+ 3 - 1
tests/test/tmt1.pp

@@ -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;