From 740926555f6813d64bbb1b30b6be0ca72e95314b Mon Sep 17 00:00:00 2001 From: Pavel Rochnyack Date: Sun, 15 May 2016 03:42:28 +0600 Subject: [PATCH] perl plugin: Mark thread as running to avoid deadlock moved from perl_shutdown() to c_ithread_destroy() --- src/perl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/perl.c b/src/perl.c index 04745c85..1dd57a2b 100644 --- a/src/perl.c +++ b/src/perl.c @@ -1229,6 +1229,10 @@ static void c_ithread_destroy (c_ithread_t *ithread) assert (NULL != perl_threads); PERL_SET_CONTEXT (aTHX); + /* Mark as running to avoid deadlock: + c_ithread_destroy -> log_debug -> perl_log() + */ + ithread->running = 1; log_debug ("Shutting down Perl interpreter %p...", aTHX); #if COLLECT_DEBUG @@ -2371,10 +2375,6 @@ static int perl_shutdown (void) pthread_kill (thr->pthread, SIGTERM); ERROR ("perl shutdown: Thread hangs inside Perl. Thread killed."); } - /* Mark as running to avoid deadlock: - c_ithread_destroy -> log_debug -> perl_log() - */ - thr->running = 1; c_ithread_destroy (thr); } -- 2.30.2