summaryrefslogtreecommitdiff
path: root/sql/threadpool_unix.cc
diff options
context:
space:
mode:
authorDaniel Black <daniel.black@au.ibm.com>2017-07-02 11:26:02 +1000
committerSergey Vojtovich <svoj@mariadb.org>2017-07-03 12:51:30 +0400
commit623c3f673195e143338cb657df554e397097fb42 (patch)
tree5220025ef37a8bb2f68d5892109d51ba7707eb49 /sql/threadpool_unix.cc
parentcb870674d437d1f544ad0ccb2c759207b1735e8e (diff)
downloadmariadb-git-623c3f673195e143338cb657df554e397097fb42.tar.gz
thread_group_close: release mutex in all branches
Found by Coverity scan - id 92087
Diffstat (limited to 'sql/threadpool_unix.cc')
-rw-r--r--sql/threadpool_unix.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/sql/threadpool_unix.cc b/sql/threadpool_unix.cc
index 6075c758e40..0ffe08a8051 100644
--- a/sql/threadpool_unix.cc
+++ b/sql/threadpool_unix.cc
@@ -979,24 +979,26 @@ static void thread_group_close(thread_group_t *thread_group)
if (pipe(thread_group->shutdown_pipe))
{
- DBUG_VOID_RETURN;
+ goto end;
}
/* Wake listener */
if (io_poll_associate_fd(thread_group->pollfd,
thread_group->shutdown_pipe[0], NULL))
{
- DBUG_VOID_RETURN;
+ goto end;
+ }
+ {
+ char c= 0;
+ if (write(thread_group->shutdown_pipe[1], &c, 1) < 0)
+ goto end;
}
- char c= 0;
- if (write(thread_group->shutdown_pipe[1], &c, 1) < 0)
- DBUG_VOID_RETURN;
-
/* Wake all workers. */
while(wake_thread(thread_group) == 0)
{
}
+end:
mysql_mutex_unlock(&thread_group->mutex);
DBUG_VOID_RETURN;