mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-07 13:15:04 -06:00
9.21
This commit is contained in:
committed by
Kornel Lesiński
parent
de4f8c22fe
commit
35596517f2
@@ -10,7 +10,7 @@ static THREAD_FUNC_DECL CoderThread(void *p)
|
||||
{
|
||||
CVirtThread *t = (CVirtThread *)p;
|
||||
t->StartEvent.Lock();
|
||||
if (t->ExitEvent)
|
||||
if (t->Exit)
|
||||
return 0;
|
||||
t->Execute();
|
||||
t->FinishedEvent.Set();
|
||||
@@ -23,7 +23,7 @@ WRes CVirtThread::Create()
|
||||
RINOK(FinishedEvent.CreateIfNotCreated());
|
||||
StartEvent.Reset();
|
||||
FinishedEvent.Reset();
|
||||
ExitEvent = false;
|
||||
Exit = false;
|
||||
if (Thread.IsCreated())
|
||||
return S_OK;
|
||||
return Thread.Create(CoderThread, this);
|
||||
@@ -31,16 +31,18 @@ WRes CVirtThread::Create()
|
||||
|
||||
void CVirtThread::Start()
|
||||
{
|
||||
ExitEvent = false;
|
||||
Exit = false;
|
||||
StartEvent.Set();
|
||||
}
|
||||
|
||||
CVirtThread::~CVirtThread()
|
||||
void CVirtThread::WaitThreadFinish()
|
||||
{
|
||||
ExitEvent = true;
|
||||
Exit = true;
|
||||
if (StartEvent.IsCreated())
|
||||
StartEvent.Set();
|
||||
if (Thread.IsCreated())
|
||||
{
|
||||
Thread.Wait();
|
||||
Thread.Close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user