mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 19:00:01 +08:00
优化代码
This commit is contained in:
parent
d9965b23ec
commit
c9b91ca7af
@ -228,11 +228,6 @@ static onceToken s_token([](){
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
int main(int argc,char *argv[]) {
|
int main(int argc,char *argv[]) {
|
||||||
//设置退出信号处理函数
|
|
||||||
static semaphore sem;
|
|
||||||
signal(SIGINT, [](int) { sem.post(); });// 设置退出信号
|
|
||||||
signal(SIGHUP, [](int) { loadIniConfig(); });
|
|
||||||
|
|
||||||
//设置日志
|
//设置日志
|
||||||
Logger::Instance().add(std::make_shared<ConsoleChannel>());
|
Logger::Instance().add(std::make_shared<ConsoleChannel>());
|
||||||
Logger::Instance().add(std::make_shared<FileChannel>());
|
Logger::Instance().add(std::make_shared<FileChannel>());
|
||||||
@ -355,6 +350,10 @@ int main(int argc,char *argv[]) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//设置退出信号处理函数
|
||||||
|
static semaphore sem;
|
||||||
|
signal(SIGINT, [](int) { sem.post(); });// 设置退出信号
|
||||||
|
signal(SIGHUP, [](int) { loadIniConfig(); });
|
||||||
sem.wait();
|
sem.wait();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user