blob: 161576463a0870bc9e4d25cac6482488014ca928 (
plain) (
blame)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
unit PseudoThread;
{$IFDEF FPC}
{$MODE Delphi}
{$ENDIF}
{$I switches.inc}
interface
type
// Debugging threads with XCode doesn't seem to work.
// We use PseudoThread in Debug mode to get proper debugging.
TPseudoThread = class(TObject)
private
protected
Terminated,
FreeOnTerminate : Boolean;
procedure Execute; virtual; abstract;
procedure Resume;
procedure Suspend;
public
constructor Create(const suspended : Boolean);
end;
implementation
{ TPseudoThread }
constructor TPseudoThread.Create(const suspended : Boolean);
begin
if not suspended then begin
Execute;
end;
end;
procedure TPseudoThread.Resume;
begin
Execute;
end;
procedure TPseudoThread.Suspend;
begin
end;
end.
|