refactor
This commit is contained in:
6
main.cpp
6
main.cpp
@@ -42,7 +42,7 @@ struct Sensors {
|
||||
std::mutex mtx; // making sure the struct isnt accessed by multiple threads at once
|
||||
};
|
||||
|
||||
void sighandler(int) {
|
||||
void signalHandler(int) {
|
||||
log(LOG::WRN, "got SIGINT/SIGTERM, exiting...");
|
||||
sem::main.release();
|
||||
sem::display.release();
|
||||
@@ -166,8 +166,8 @@ void displayThread(std::stop_token st, Sensors* s) {
|
||||
|
||||
int main() {
|
||||
log(LOG::START, "============================= PROGRAM START ============================="); // to make logs clearer
|
||||
std::signal(SIGINT, sighandler);
|
||||
std::signal(SIGTERM, sighandler);
|
||||
std::signal(SIGINT, signalHandler);
|
||||
std::signal(SIGTERM, signalHandler);
|
||||
|
||||
{
|
||||
std::unique_ptr<Sensors> pSensors = std::make_unique<Sensors>();
|
||||
|
||||
Reference in New Issue
Block a user