summaryrefslogtreecommitdiffstats
path: root/libdimension/threads.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2010-09-29 17:54:03 -0400
committerTavian Barnes <tavianator@gmail.com>2010-09-29 19:03:10 -0400
commit9666ad922524b617947590aed4c6fde5febab53a (patch)
treeb51c459670fac0f1d36b70e055f31ce1d641c4ef /libdimension/threads.c
parentcec47afae217cea36779d7dea4437b35dee63be2 (diff)
downloaddimension-9666ad922524b617947590aed4c6fde5febab53a.tar.xz
Make dmnsn_new_thread() bail out on errors.
Diffstat (limited to 'libdimension/threads.c')
-rw-r--r--libdimension/threads.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libdimension/threads.c b/libdimension/threads.c
index 22a5b9a..1f1acd5 100644
--- a/libdimension/threads.c
+++ b/libdimension/threads.c
@@ -46,7 +46,7 @@ dmnsn_thread(void *arg)
return ret;
}
-int
+void
dmnsn_new_thread(dmnsn_progress *progress, const pthread_attr_t *attr,
dmnsn_thread_fn *thread_fn, void *arg)
{
@@ -55,5 +55,7 @@ dmnsn_new_thread(dmnsn_progress *progress, const pthread_attr_t *attr,
payload->arg = arg;
payload->progress = progress;
- return pthread_create(&progress->thread, attr, &dmnsn_thread, payload);
+ if (pthread_create(&progress->thread, attr, &dmnsn_thread, payload) != 0) {
+ dmnsn_error(DMNSN_SEVERITY_HIGH, "Couldn't start thread.");
+ }
}