Browse Source

* add testcase of issue #11006 to testsuite

git-svn-id: trunk@10493 -
micha 17 years ago
parent
commit
eae3754ab7
2 changed files with 40 additions and 0 deletions
  1. 1 0
      .gitattributes
  2. 39 0
      tests/webtbs/tw11006.pp

+ 1 - 0
.gitattributes

@@ -8105,6 +8105,7 @@ tests/webtbs/tw1096.pp svneol=native#text/plain
 tests/webtbs/tw10966.pp svneol=native#text/plain
 tests/webtbs/tw1097.pp svneol=native#text/plain
 tests/webtbs/tw10979.pp svneol=native#text/plain
+tests/webtbs/tw11006.pp svneol=native#text/plain
 tests/webtbs/tw1103.pp svneol=native#text/plain
 tests/webtbs/tw1104.pp svneol=native#text/plain
 tests/webtbs/tw1111.pp svneol=native#text/plain

+ 39 - 0
tests/webtbs/tw11006.pp

@@ -0,0 +1,39 @@
+{$mode objfpc}
+
+uses
+{$ifdef unix}
+  cthreads,
+{$endif}
+  sysutils,
+  classes;
+
+type
+  tmythread = class(tthread)
+    fs: ansistring;
+    constructor create(const s: ansistring);
+    procedure execute; override;
+  end;
+
+constructor tmythread.create(const s: ansistring);
+begin
+  fs:=s+'a';
+  freeonterminate:=true;
+  inherited create(true);
+end;
+
+procedure tmythread.execute;
+begin
+  sleep(60);
+  writeln('done');
+end;
+
+var
+  a: array[1..100] of tmythread;
+  i: longint;
+begin
+  for i:=low(a) to high(a) do
+    a[i]:=tmythread.create('b');
+  for i:=low(a) to high(a) do
+    a[i].resume;
+  sleep(60);
+end.