summaryrefslogtreecommitdiff
path: root/fpcsrc/tests/webtbs/tw2794.pp
blob: c35722166bb95d5502446d8c9f95ebe624938d49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{ Source provided for Free Pascal Bug Report 2794 }
{ Submitted by "Johannes Berg" on  2003-11-17 }
{ e-mail: bugs@johannes.sipsolutions.de }
program test;
{$ifdef fpc}
  {$THREADING ON}
  {$MODE OBJFPC}
{$endif}

uses
  {$ifdef fpc}{$ifdef unix}CThreads,{$endif}{$endif}
  Classes;

type
  TMyThread = class(TThread)
    procedure Execute;override;
  end;

threadvar
  x: ansistring;

procedure TMyThread.Execute;
begin
  x := 'asdf';
  x := x + x;
  writeln(x);
end;

begin
  TMyThread.Create(false).Free;
end.