win32_service

This commit is contained in:
mikhail4021 2014-02-22 12:01:51 +04:00
parent 6a7224d9f3
commit 7f57980c20
5 changed files with 86 additions and 98 deletions

View file

@ -99,6 +99,13 @@ namespace util
public:
MsgQueue (): m_Thread (std::bind (&MsgQueue<Msg>::Run, this)) , running(1) {};
/*
~MsgQueue()
{
WakeUp();
Stop();
}
*/
void Stop()
{
running = 0;
@ -109,7 +116,7 @@ namespace util
void Run ()
{
Msg * msg = nullptr;
while ((msg = Queue<Msg>::GetNext ()) != nullptr && running)
while (((msg = Queue<Msg>::GetNext ()) != nullptr) && running)
{
msg->Process ();
delete msg;