-
Notifications
You must be signed in to change notification settings - Fork 0
/
CleanupThread.cpp
57 lines (45 loc) · 1.37 KB
/
CleanupThread.cpp
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
// ---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "CleanupThread.h"
#include "functions.h"
#include "reqthread.h"
#include "graphthread.h"
#include "../mye/mye.h"
#include "mainform.h"
#pragma package(smart_init)
extern wnd_buttons_v wnd_buttons;
extern bool delete_wnd_buttons_job;
extern TCriticalSection *wcs;
// ---------------------------------------------------------------------------
// Important: Methods and properties of objects in VCL can only be
// used in a method called using Synchronize, for example:
//
// Synchronize(&UpdateCaption);
//
// where UpdateCaption could look like:
//
// void __fastcall CleanupThread::UpdateCaption()
// {
// Form1->Caption = "Updated in a thread";
// }
// ---------------------------------------------------------------------------
__fastcall CleanupThread::CleanupThread(bool CreateSuspended):TThread(CreateSuspended)
{
}
// ---------------------------------------------------------------------------
void __fastcall CleanupThread::Execute()
{
NameThreadForDebugging("CleanupThread");
DWORD freed = 0;
while (1)
{
freed = 0;
if (delete_wnd_buttons_job)
{
delete_wnd_buttons_job = false;
}
Sleep(1);
}
}
// ---------------------------------------------------------------------------