forked from adaloveless/commonx
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBackgroundThreads.pas
More file actions
57 lines (38 loc) · 1.18 KB
/
BackgroundThreads.pas
File metadata and controls
57 lines (38 loc) · 1.18 KB
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
unit BackgroundThreads;
//This unit holds a global variable for a singleton instance of TThreadManager
//called BackgroudnThreadMan. Read BackgroundThreadMan to get the status of
//all BAckground threads running in the PWLN system. This includes the
//"Janitor" cleanup thread, ERater-retry thread, Session Timeout thread, and
//1-n temporary threads that occasionally appear for fetching accounts from the data-tier(s).
//There are no classes defined here, and there is no significant code.
interface
uses
Managedthread,
{$IFDEF WINDOWS}
winapi.windows,
{$ENDIF}
orderlyinit;
var
GFBackgroundThreadMan : TThreadManager =nil;
function BackgroundThreadMan: TThreadManager;
implementation
function BackgroundThreadMan: TThreadManager;
begin
if GFBackgroundThreadMan = nil then
GFBackgroundThreadMan := TThreadManager.create;
result := GFBackgroundThreadMan;
end;
procedure oinit;
begin
// GFBackgroundThreadMan := TThreadManager.create;
BackgroundThreadMan;
end;
procedure ofinal;
begin
if assigned(GFBackgroundThreadMan) then
GFBackgroundThreadMan.free;
end;
initialization
init.RegisterProcs('BackgroundThreads', oinit, ofinal, 'ManagedThread');
finalization
end.