From 972f0ad9065ce4ae5ca68c1bfdb7ac81afb302c5 Mon Sep 17 00:00:00 2001 From: Mr-Dave Date: Sat, 21 Jan 2023 14:24:27 -0700 Subject: [PATCH] Revise running_cam to running_dev --- src/motion_loop.cpp | 4 ++-- src/motionplus.cpp | 12 ++++++------ src/motionplus.hpp | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/motion_loop.cpp b/src/motion_loop.cpp index 75fd7780..d849fc91 100644 --- a/src/motion_loop.cpp +++ b/src/motion_loop.cpp @@ -1423,7 +1423,7 @@ void *motion_loop(void *arg) { ctx_dev *cam =(ctx_dev *) arg; - cam->running_cam = true; + cam->running_dev = true; pthread_mutex_lock(&cam->motapp->global_lock); cam->motapp->threads_running++; @@ -1463,7 +1463,7 @@ void *motion_loop(void *arg) pthread_mutex_unlock(&cam->motapp->global_lock); cam->finish_dev = true; - cam->running_cam = false; + cam->running_dev = false; pthread_exit(NULL); } diff --git a/src/motionplus.cpp b/src/motionplus.cpp index 52b3b608..626f530c 100644 --- a/src/motionplus.cpp +++ b/src/motionplus.cpp @@ -452,7 +452,7 @@ static void motion_watchdog(ctx_motapp *motapp, int camindx) { int indx; - if (motapp->cam_list[camindx]->running_cam == false) { + if (motapp->cam_list[camindx]->running_dev == false) { return; } @@ -522,13 +522,13 @@ static void motion_watchdog(ctx_motapp *motapp, int camindx) pthread_kill(motapp->cam_list[indx]->netcam_high->thread_id, SIGVTALRM); } } - if (motapp->cam_list[indx]->running_cam == true) { + if (motapp->cam_list[indx]->running_dev == true) { MOTION_LOG(ERR, TYPE_ALL, NO_ERRNO , _("Camera %d - Watchdog kill.") , motapp->cam_list[indx]->camera_id); pthread_kill(motapp->cam_list[indx]->thread_id, SIGVTALRM); }; - motapp->cam_list[indx]->running_cam = false; + motapp->cam_list[indx]->running_dev = false; motapp->cam_list[indx]->restart_dev = false; indx++; } @@ -546,7 +546,7 @@ static int motion_check_threadcount(ctx_motapp *motapp) thrdcnt = 0; for (indx=0; indxcam_cnt; indx++) { - if (motapp->cam_list[indx]->running_cam || motapp->cam_list[indx]->restart_dev) { + if (motapp->cam_list[indx]->running_dev || motapp->cam_list[indx]->restart_dev) { thrdcnt++; } } @@ -662,7 +662,7 @@ static void motion_cam_delete(ctx_motapp *motapp) maxcnt = 100; indx1 = 0; - while ((cam->running_cam) && (indx1 < maxcnt)) { + while ((cam->running_dev) && (indx1 < maxcnt)) { SLEEP(0, 50000000) indx1++; } @@ -736,7 +736,7 @@ int main (int argc, char **argv) for (indx=0; indxcam_cnt; indx++) { /* Check if threads wants to be restarted */ - if ((motapp->cam_list[indx]->running_cam == false) && + if ((motapp->cam_list[indx]->running_dev == false) && (motapp->cam_list[indx]->restart_dev == true)) { MOTION_LOG(NTC, TYPE_ALL, NO_ERRNO ,_("MotionPlus camera %d restart") diff --git a/src/motionplus.hpp b/src/motionplus.hpp index ece02e4b..98672a15 100644 --- a/src/motionplus.hpp +++ b/src/motionplus.hpp @@ -342,7 +342,7 @@ struct ctx_dev { volatile bool event_user; /* Boolean for whether to user triggered an event */ volatile bool finish_dev; /* End the device thread */ volatile bool restart_dev; /* Restart the device thread when it ends */ - bool running_cam; /* thread is running*/ + bool running_dev; /* Device thread is running*/ volatile int watchdog; int event_nr;