summaryrefslogtreecommitdiffstats
path: root/src/libnetdata/threads/threads.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/libnetdata/threads/threads.c (renamed from libnetdata/threads/threads.c)5
1 files changed, 3 insertions, 2 deletions
diff --git a/libnetdata/threads/threads.c b/src/libnetdata/threads/threads.c
index c14f9a7eb..94761671a 100644
--- a/libnetdata/threads/threads.c
+++ b/src/libnetdata/threads/threads.c
@@ -281,8 +281,9 @@ static void *netdata_thread_init(void *ptr) {
}
void *ret = NULL;
- pthread_cleanup_push(thread_cleanup, ptr);
- ret = netdata_thread->start_routine(netdata_thread->arg);
+ pthread_cleanup_push(thread_cleanup, ptr) {
+ ret = netdata_thread->start_routine(netdata_thread->arg);
+ }
pthread_cleanup_pop(1);
return ret;