mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 06:28:55 +02:00
parent
ae8289f9f7
commit
eae3754ab7
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -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
tests/webtbs/tw11006.pp
Normal file
39
tests/webtbs/tw11006.pp
Normal file
@ -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.
|
Loading…
Reference in New Issue
Block a user