mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-05 12:29:32 +01:00
+ tthread.start method, simply calls tthread.resume for now (mantis #16326)
git-svn-id: trunk@15165 -
This commit is contained in:
parent
34487fa455
commit
c67712f81f
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -10353,6 +10353,7 @@ tests/webtbs/tw1622.pp svneol=native#text/plain
|
|||||||
tests/webtbs/tw16222.pp svneol=native#text/pascal
|
tests/webtbs/tw16222.pp svneol=native#text/pascal
|
||||||
tests/webtbs/tw1623.pp svneol=native#text/plain
|
tests/webtbs/tw1623.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw16311.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/tw16328.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw1634.pp svneol=native#text/plain
|
tests/webtbs/tw1634.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw1658.pp svneol=native#text/plain
|
tests/webtbs/tw1658.pp svneol=native#text/plain
|
||||||
|
|||||||
@ -106,6 +106,14 @@ function ThreadProc(ThreadObjPtr: Pointer): PtrInt;
|
|||||||
{ system-dependent code }
|
{ system-dependent code }
|
||||||
{$i tthread.inc}
|
{$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;
|
function TThread.GetSuspended: Boolean;
|
||||||
begin
|
begin
|
||||||
|
|||||||
@ -1504,6 +1504,7 @@ type
|
|||||||
const StackSize: SizeUInt = DefaultStackSize);
|
const StackSize: SizeUInt = DefaultStackSize);
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure AfterConstruction; override;
|
procedure AfterConstruction; override;
|
||||||
|
procedure Start;
|
||||||
procedure Resume;
|
procedure Resume;
|
||||||
procedure Suspend;
|
procedure Suspend;
|
||||||
procedure Terminate;
|
procedure Terminate;
|
||||||
|
|||||||
28
tests/webtbs/tw16326.pp
Normal file
28
tests/webtbs/tw16326.pp
Normal 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.
|
||||||
Loading…
Reference in New Issue
Block a user