1 #include <boost/thread.hpp>
3 #include "base_store.h"
4 #include "base_settings.h"
7 // TODO: Fix this shit!!!
8 #include "../../../users.h"
9 #include "../../../tariffs.h"
10 #include "../../../admins.h"
11 #include "../../../settings.h"
13 #include "stgconfig.h"
15 STGCONFIG2::STGCONFIG2()
21 ct(admins, tariffs, users, stgSettings)
23 thread = new boost::thread;
26 STGCONFIG2::~STGCONFIG2()
31 int STGCONFIG2::ParseSettings()
36 int STGCONFIG2::Start()
38 ct.SetClasses(admins, tariffs, users, stgSettings);
39 *thread = boost::thread(boost::ref(ct));
43 int STGCONFIG2::Stop()
46 if (!thread->timed_join(boost::get_system_time() + boost::posix_time::milliseconds(5000))) {
48 printfd(__FILE__, "STGCONFIG2::Stop() Thread not stopped.\n");
49 errorStr = "Failed to stop config thread.";
55 bool STGCONFIG2::IsRunning()