Browse Source

* initial revision

florian 23 years ago
parent
commit
c905878b67
1 changed files with 26 additions and 0 deletions
  1. 26 0
      tests/test/tmt1.pas

+ 26 - 0
tests/test/tmt1.pas

@@ -0,0 +1,26 @@
+{ %version=1.1 }
+
+const
+   threadcount = 100;
+   finished : longint = 0;
+
+function f(p : pointer) : longint;
+  var
+     s : ansistring;
+     i : longint;
+  begin
+     for i:=1 to 1000000 div threadcount do
+       s:=s+'1';
+     inc(finished);
+  end;
+
+var
+   i : longint;
+
+begin
+   for i:=1 to threadcount do
+     BeginThread(@f);
+   while finished<threadcount do
+     ;
+   writeln(finished);
+end.