+ tthread.start method, simply calls tthread.resume for now (mantis #16326)

git-svn-id: trunk@15165 -
This commit is contained in:
Jonas Maebe 2010-04-24 14:52:08 +00:00
parent 34487fa455
commit c67712f81f
4 changed files with 38 additions and 0 deletions

1
.gitattributes vendored
View File

@ -10353,6 +10353,7 @@ tests/webtbs/tw1622.pp svneol=native#text/plain
tests/webtbs/tw16222.pp svneol=native#text/pascal
tests/webtbs/tw1623.pp svneol=native#text/plain
tests/webtbs/tw16311.pp svneol=native#text/plain
tests/webtbs/tw16326.pp svneol=native#text/plain
tests/webtbs/tw16328.pp svneol=native#text/plain
tests/webtbs/tw1634.pp svneol=native#text/plain
tests/webtbs/tw1658.pp svneol=native#text/plain

View File

@ -106,6 +106,14 @@ function ThreadProc(ThreadObjPtr: Pointer): PtrInt;
{ system-dependent code }
{$i tthread.inc}
procedure TThread.Start;
begin
{ suspend/resume are now deprecated in Delphi (they also don't work
on most platforms in FPC), so a different method was required
to start a thread if it's create with fSuspended=true -> that's
what this method is for. }
Resume;
end;
function TThread.GetSuspended: Boolean;
begin

View File

@ -1504,6 +1504,7 @@ type
const StackSize: SizeUInt = DefaultStackSize);
destructor Destroy; override;
procedure AfterConstruction; override;
procedure Start;
procedure Resume;
procedure Suspend;
procedure Terminate;

28
tests/webtbs/tw16326.pp Normal file
View File

@ -0,0 +1,28 @@
{$mode objfpc}
{$H+}
uses
{$ifdef unix}
cthreads,
{$endif}
classes
;
type
tthread1 = class(tthread)
public
procedure execute; override;
end;
procedure tthread1.execute;
begin
end;
var
thread1: tthread1;
begin
thread1 := tthread1.create(true);
thread1.start;
thread1.waitfor;
thread1.free;
end.