/
installthread.pas
executable file
·72 lines (51 loc) · 1.12 KB
/
installthread.pas
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
unit installthread;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils,variants,oldlinux;
type
mThread = class(TThread)
private
CountLocked:integer;
CountTime:integer;
ProcThreadStatus:boolean;
MaxCount:integer;
protected
procedure Execute; override;
public
function StartExecution(isDebug:boolean):boolean;
pid:integer;
debug:boolean;
FileToFollow:string;
end;
implementation
var
ID_local: integer;
cmd_local: string;
Time_local: integer;
procedure mThread.Execute;
begin
ProcThreadStatus:=False;
while not ProcThreadStatus do begin
StartExecution(false);
end;
end;
function mThread.StartExecution(isDebug:boolean):boolean;
var
list:TstringList;
i:integer;
begin
Select(0,nil,nil,nil,100);
if FileExists(FileToFollow) then begin
list:=TstringList.Create;
list.LoadFromFile(FileToFollow);
if list.Count-1>MaxCount then begin
For i:=MaxCount to list.Count-1 do begin
writeln(trim(list[i]));
MaxCount:=i;
end;
end;
list.free;
end;
end;
end.