commit c1bc0ce13f61ca636b9ba893eb6bdd1b6ba696d2
parent 257486d74adc52193f58e9c278452a87f113338c
Author: Joris Vink <joris@coders.se>
Date: Sun, 27 Jul 2014 21:47:18 +0200
Check return value for pthread_mutex_init()
Diffstat:
src/tasks.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/tasks.c b/src/tasks.c
@@ -48,10 +48,13 @@ static void task_thread_spawn(struct kore_task_thread **);
void
kore_task_init(void)
{
+ int r;
+
threads = 0;
TAILQ_INIT(&task_threads);
- pthread_mutex_init(&task_thread_lock, NULL);
+ if ((r = pthread_mutex_init(&task_thread_lock, NULL)) != 0)
+ fatal("kore_task_init: pthread_mutex_init: %d", r);
}
void