File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3848,18 +3848,22 @@ API void
38483848nc_server_notif_cert_expiration_thread_stop (int wait )
38493849{
38503850 int r ;
3851+ pthread_t tid ;
38513852
38523853 /* LOCK */
38533854 pthread_mutex_lock (& server_opts .cert_exp_notif .lock );
3855+ tid = server_opts .cert_exp_notif .tid ;
3856+
38543857 if (server_opts .cert_exp_notif .thread_running ) {
3855- /* set the running flag to 0, signal the thread and unlock its mutex */
3858+ /* set the tid and running flag to 0, signal the thread and unlock its mutex */
38563859 server_opts .cert_exp_notif .thread_running = 0 ;
3860+ server_opts .cert_exp_notif .tid = 0 ;
38573861 pthread_cond_signal (& server_opts .cert_exp_notif .cond );
38583862
38593863 /* UNLOCK */
38603864 pthread_mutex_unlock (& server_opts .cert_exp_notif .lock );
38613865 if (wait ) {
3862- r = pthread_join (server_opts . cert_exp_notif . tid , NULL );
3866+ r = pthread_join (tid , NULL );
38633867 if (r ) {
38643868 ERR (NULL , "Joining the certificate expiration notification thread failed (%s)." , strerror (r ));
38653869 }
You can’t perform that action at this time.
0 commit comments