6 |
|
|
7 |
|
#include "Daemon.hpp" |
8 |
|
|
9 |
< |
Daemon::Daemon() : running(true), loaded(false), thread(new api::Thread(etl::BindAll(&Daemon::loop, this))) {} |
10 |
< |
|
11 |
< |
void Daemon::load() |
9 |
> |
void Daemon::wait() |
10 |
|
{ |
11 |
< |
api::Cerr << this << ios::NewLine; |
11 |
> |
if (!thread.IsEmpty()) |
12 |
> |
{ |
13 |
> |
thread->Join(); |
14 |
|
|
15 |
< |
loaded = true; |
15 |
> |
thread.Clear(); |
16 |
> |
} |
17 |
|
} |
18 |
|
|
19 |
< |
void Daemon::run() |
19 |
> |
void Daemon::start() |
20 |
|
{ |
21 |
< |
api::Cerr << this << ios::NewLine; |
22 |
< |
|
22 |
< |
running = false; |
21 |
> |
running = true; |
22 |
> |
thread = new api::Thread(etl::BindAll(&Daemon::loop, this)); |
23 |
|
} |
24 |
|
|
25 |
|
int Daemon::loop() |