summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rts/posix/itimer/Pthread.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/rts/posix/itimer/Pthread.c b/rts/posix/itimer/Pthread.c
index d8f2497e3f..817c40f218 100644
--- a/rts/posix/itimer/Pthread.c
+++ b/rts/posix/itimer/Pthread.c
@@ -147,8 +147,6 @@ static void *itimer_thread_func(void *_handle_tick)
if (USE_TIMERFD_FOR_ITIMER)
close(timerfd);
- closeMutex(&mutex);
- closeCondition(&start_cond);
return NULL;
}
@@ -207,6 +205,8 @@ exitTicker (bool wait)
if (pthread_join(thread, NULL)) {
sysErrorBelch("Itimer: Failed to join");
}
+ closeMutex(&mutex);
+ closeCondition(&start_cond);
} else {
pthread_detach(thread);
}