22 |
|
class Daemon |
23 |
|
{ |
24 |
|
private: |
25 |
– |
#ifdef __FreeBSD__ |
26 |
– |
static ext::String secret; |
27 |
– |
#endif |
25 |
|
const api::Path& config; |
26 |
|
bool running, loaded; |
27 |
+ |
unsigned interval/*, count*/; |
28 |
|
_H<api::Thread> thread; |
29 |
|
int loop(); |
30 |
|
void load(); |
31 |
|
template <typename Worker> |
32 |
|
int work(); |
33 |
+ |
template <typename Worker> |
34 |
+ |
int work_(const Share& share); |
35 |
+ |
void sleep(); |
36 |
|
public: |
37 |
< |
Daemon(const ext::String& config) : config(config), running(true), loaded(false), thread(new api::Thread(etl::BindAll(&Daemon::loop, this))) {} |
37 |
> |
Daemon(const api::Path& config) : config(config), running(true), loaded(false), interval(60), count(0), thread(new api::Thread(etl::BindAll(&Daemon::loop, this))) {} |
38 |
|
~Daemon(); |
39 |
|
static ext::RedBlackSet<Share> shares; |
40 |
+ |
// static api::ThreadMutex smbcLock; |
41 |
+ |
#ifdef __FreeBSD__ |
42 |
+ |
static ext::String secret; |
43 |
+ |
#endif |
44 |
|
void reload() { loaded = false; } |
45 |
|
void stop() { running = false; } |
46 |
|
}; |