diff options
author | Tavian Barnes <tavianator@gmail.com> | 2009-10-26 00:54:15 +0000 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2009-10-26 00:54:15 +0000 |
commit | 0bb6bfe0b08eb9fc2ba62f64bdb21cb5b592c292 (patch) | |
tree | e7ef618a917290a530cc2faec586724ac0265a60 /libdimension/raytrace.c | |
parent | 75f20754030726569ac8cbc243628c18e523f3bb (diff) | |
download | dimension-0bb6bfe0b08eb9fc2ba62f64bdb21cb5b592c292.tar.xz |
Fix some concurrency mistakes.
TODO: eliminate the too_late field on canvases.
Diffstat (limited to 'libdimension/raytrace.c')
-rw-r--r-- | libdimension/raytrace.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libdimension/raytrace.c b/libdimension/raytrace.c index bb88940..6cb6d8b 100644 --- a/libdimension/raytrace.c +++ b/libdimension/raytrace.c @@ -133,7 +133,7 @@ dmnsn_raytrace_scene_multithread(dmnsn_raytrace_payload *payload) dmnsn_new_progress_element(payload->progress, nthreads*payload->scene->canvas->y); - /* Create the threads */ + /* Create the payloads */ for (i = 0; i < nthreads; ++i) { payloads[i] = *payload; payloads[i].index = i; @@ -142,7 +142,10 @@ dmnsn_raytrace_scene_multithread(dmnsn_raytrace_payload *payload) payloads[i].kD_splay_tree = dmnsn_kD_splay_copy(payloads[0].kD_splay_tree); } + } + /* Create the threads */ + for (i = 0; i < nthreads; ++i) { if (pthread_create(&threads[i], NULL, &dmnsn_raytrace_scene_multithread_thread, &payloads[i]) != 0) |