MCPcopy Create free account
hub / github.com/acl-dev/acl / run_alone

Method run_alone

lib_acl_cpp/src/master/master_trigger.cpp:42–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42void master_trigger::run_alone(const char* path /* = NULL */,
43 int count /* = 1 */, int interval /* = 1 */)
44{
45 // ÿ������ֻ����һ��ʵ��������
46 acl_assert(has_called == false);
47 has_called = true;
48 daemon_mode_ = false;
49#ifdef ACL_WINDOWS
50 acl_cpp_init();
51#endif
52 if (interval <= 0) {
53 interval = 1;
54 }
55
56 // ��ʼ�����ò���
57 conf_.load(path);
58
59 service_pre_jail(this);
60 service_init(this);
61
62 int i = 0;
63 while (true) {
64 sleep(interval);
65 service_main(this);
66 if (count > 0 && ++i >= count) {
67 break;
68 }
69 }
70
71 service_exit(this);
72}
73
74const char* master_trigger::get_conf_path() const
75{

Callers

nothing calls this directly

Calls 6

acl_cpp_initFunction · 0.85
service_initFunction · 0.50
sleepFunction · 0.50
service_mainFunction · 0.50
service_exitFunction · 0.50
loadMethod · 0.45

Tested by

no test coverage detected