diff --git a/src/clib/lib/job_queue/lsf_driver.cpp b/src/clib/lib/job_queue/lsf_driver.cpp index b83a1dd7b8d..b39482d5e02 100644 --- a/src/clib/lib/job_queue/lsf_driver.cpp +++ b/src/clib/lib/job_queue/lsf_driver.cpp @@ -104,7 +104,7 @@ struct lsf_driver_struct { std::vector exclude_hosts{}; char *login_shell = nullptr; char *project_code = nullptr; - pthread_mutex_t submit_lock; + pthread_mutex_t submit_lock{}; lsf_submit_method_enum submit_method = LSF_SUBMIT_LOCAL_SHELL; int submit_sleep = 0; @@ -114,7 +114,7 @@ struct lsf_driver_struct { /*-----------------------------------------------------------------*/ /* Fields used by the shell based functions */ bool debug_output = false; - int bjobs_refresh_interval; + int bjobs_refresh_interval = 0; time_t last_bjobs_update = time(nullptr); /** A hash table of all jobs submitted by this ERT instance - to ensure * that we do not check status of old jobs in e.g. ZOMBIE status. */ @@ -122,7 +122,7 @@ struct lsf_driver_struct { /** The output of calling bjobs is cached in this table. */ hash_type *bjobs_cache; /** Only one thread should update the bjobs_chache table. */ - pthread_mutex_t bjobs_mutex; + pthread_mutex_t bjobs_mutex{}; char *remote_lsf_server = nullptr; char *rsh_cmd = nullptr; char *bsub_cmd = nullptr; @@ -922,8 +922,6 @@ static void lsf_driver_shell_init(lsf_driver_type *lsf_driver) { lsf_driver->last_bjobs_update = time(nullptr); lsf_driver->bjobs_cache = hash_alloc(); lsf_driver->my_jobs = hash_alloc(); - - pthread_mutex_init(&lsf_driver->bjobs_mutex, nullptr); } bool lsf_driver_has_project_code(const lsf_driver_type *driver) { @@ -932,7 +930,6 @@ bool lsf_driver_has_project_code(const lsf_driver_type *driver) { void *lsf_driver_alloc() { lsf_driver_type *lsf_driver = new lsf_driver_type(); - pthread_mutex_init(&lsf_driver->submit_lock, nullptr); lsf_driver_shell_init(lsf_driver); lsf_driver_set_option(lsf_driver, LSF_SERVER, NULL);