diff options
author | Tavian Barnes <tavianator@gmail.com> | 2010-10-02 17:16:27 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2010-10-02 17:16:27 -0400 |
commit | cfe666a2f39fdf5b30c7eb22341a529ae57276e4 (patch) | |
tree | 684f605b2d63d894b34e2190a03fedf03d1ca010 /libdimension | |
parent | c532ad114ef3f9964077522d137e6e1355a1ec1b (diff) | |
download | dimension-cfe666a2f39fdf5b30c7eb22341a529ae57276e4.tar.xz |
Error out if an error occurs in a raytracing worker thread.
Diffstat (limited to 'libdimension')
-rw-r--r-- | libdimension/raytrace.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libdimension/raytrace.c b/libdimension/raytrace.c index 396c8b4..98f941b 100644 --- a/libdimension/raytrace.c +++ b/libdimension/raytrace.c @@ -118,10 +118,17 @@ dmnsn_raytrace_scene_thread(void *ptr) } for (int i = 0; i < nthreads; ++i) { - if (pthread_join(threads[i], NULL)) { + void *ptr = NULL; + if (pthread_join(threads[i], &ptr)) { dmnsn_error(DMNSN_SEVERITY_MEDIUM, "Couldn't join worker thread in raytrace engine."); } + if (ptr) { + int retval = *(int *)ptr; + dmnsn_free(ptr); + if (retval != 0) + dmnsn_error(DMNSN_SEVERITY_HIGH, "Error occurred in worker thread."); + } } dmnsn_complete_timer(payload->scene->render_timer); |