From 9168d69086da1d7126763d7e59989f31fe07f1ff Mon Sep 17 00:00:00 2001 From: steven Date: Fri, 27 Mar 2020 20:04:34 +0800 Subject: [PATCH] Unlock cond_mutex before pthread exit in gp_worker_main() --- ...efore-pthread-exit-in-gp_worker_main.patch | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Unlock-cond_mutex-before-pthread-exit-in-gp_worker_main.patch diff --git a/Unlock-cond_mutex-before-pthread-exit-in-gp_worker_main.patch b/Unlock-cond_mutex-before-pthread-exit-in-gp_worker_main.patch new file mode 100644 index 0000000..c3558b4 --- /dev/null +++ b/Unlock-cond_mutex-before-pthread-exit-in-gp_worker_main.patch @@ -0,0 +1,24 @@ +From cb761412e299ef907f22cd7c4146d50c8a792003 Mon Sep 17 00:00:00 2001 +From: Guiyao +Date: Mar 26 2020 17:54:17 +0000 +Subject: Unlock cond_mutex before pthread exit in gp_worker_main() + + +Signed-off-by: GuiYao +[rharwood@redhat.com: whitespace, tweak commit message] +Reviewed-by: Robbie Harwood + +--- + +diff --git a/src/gp_workers.c b/src/gp_workers.c +index 18f38f6..ae42cef 100644 +--- a/src/gp_workers.c ++++ b/src/gp_workers.c +@@ -369,6 +369,7 @@ static void *gp_worker_main(void *pvt) + /* wait for next query */ + pthread_cond_wait(&t->cond_wakeup, &t->cond_mutex); + if (t->pool->shutdown) { ++ pthread_mutex_unlock(&t->cond_mutex); + pthread_exit(NULL); + } + }