Add mutex lock for motionplus database

This commit is contained in:
Mr-Dave
2022-06-05 10:06:10 -06:00
parent 57bc4c9ba6
commit 2114dd7617
3 changed files with 96 additions and 35 deletions

View File

@@ -598,6 +598,7 @@ static void motion_init(struct ctx_motapp *motapp)
pthread_mutex_init(&motapp->mutex_parms, NULL);
pthread_mutex_init(&motapp->mutex_camlst, NULL);
pthread_mutex_init(&motapp->mutex_post, NULL);
pthread_mutex_init(&motapp->mutex_sqlite, NULL);
motapp->threads_running = 0;
motapp->finish_all = false;
@@ -804,6 +805,7 @@ int main (int argc, char **argv)
pthread_mutex_destroy(&motapp->mutex_parms);
pthread_mutex_destroy(&motapp->mutex_camlst);
pthread_mutex_destroy(&motapp->mutex_post);
pthread_mutex_destroy(&motapp->mutex_sqlite);
delete motapp;