summaryrefslogtreecommitdiffstats
path: root/libdimension/threads.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2011-10-19 12:37:32 -0400
committerTavian Barnes <tavianator@gmail.com>2011-10-19 14:19:43 -0400
commite9810a7b1aae15320e58371b657a2f963562834d (patch)
treec74c37b635d7c35773d9b9b57e579763ff946300 /libdimension/threads.c
parentb14a87691f42be83691861b97a2f410c25c9c4bb (diff)
downloaddimension-e9810a7b1aae15320e58371b657a2f963562834d.tar.xz
Rename progress objects to future objects.
Diffstat (limited to 'libdimension/threads.c')
-rw-r--r--libdimension/threads.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/libdimension/threads.c b/libdimension/threads.c
index 2200671..0aed16d 100644
--- a/libdimension/threads.c
+++ b/libdimension/threads.c
@@ -30,7 +30,7 @@
typedef struct dmnsn_thread_payload {
dmnsn_thread_fn *thread_fn;
void *arg;
- dmnsn_progress *progress;
+ dmnsn_future *future;
} dmnsn_thread_payload;
/** Clean up after a thread. */
@@ -38,10 +38,10 @@ static void
dmnsn_thread_cleanup(void *arg)
{
dmnsn_thread_payload *payload = arg;
- dmnsn_progress *progress = payload->progress;
+ dmnsn_future *future = payload->future;
dmnsn_free(payload);
- dmnsn_done_progress(progress);
+ dmnsn_future_done(future);
}
/** pthread callback -- call the real thread callback. */
@@ -59,15 +59,14 @@ dmnsn_thread(void *arg)
}
void
-dmnsn_new_thread(dmnsn_progress *progress, dmnsn_thread_fn *thread_fn,
- void *arg)
+dmnsn_new_thread(dmnsn_future *future, dmnsn_thread_fn *thread_fn, void *arg)
{
dmnsn_thread_payload *payload = dmnsn_malloc(sizeof(dmnsn_thread_payload));
payload->thread_fn = thread_fn;
payload->arg = arg;
- payload->progress = progress;
+ payload->future = future;
- if (pthread_create(&progress->thread, NULL, dmnsn_thread, payload) != 0) {
+ if (pthread_create(&future->thread, NULL, dmnsn_thread, payload) != 0) {
dmnsn_error("Couldn't start thread.");
}
}