medfall

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit a8686e53cc8c82aa915caa1f17714496756d113d
parent 45824016175de7364d8cc59c675df35501ae341c
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Sat Sep 19 16:04:06 +0100

Check the return value of pthread_create

Diffstat:
work_queue.cc | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/work_queue.cc b/work_queue.cc @@ -60,7 +60,10 @@ void workqueue_init( WorkQueue * const queue, MemoryArena * const arena, const u idqs[ i ] = { i, queue }; pthread_t thread; - pthread_create( &thread, nullptr, workqueue_worker, &idqs[ i ] ); + const int ok = pthread_create( &thread, nullptr, workqueue_worker, &idqs[ i ] ); + if( ok == -1 ) { + err( 1, "pthread_create" ); + } } memarena_restore( arena, &cp );