summaryrefslogtreecommitdiffstats
path: root/libdimension/future.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2012-08-21 23:08:30 -0400
committerTavian Barnes <tavianator@gmail.com>2012-08-21 23:09:51 -0400
commitc150be9eb7e0d69def245d877bd66f6df87f58a1 (patch)
tree4aa5c7cbd4fe2826538a0785dfa2dde61dd4d9f7 /libdimension/future.c
parentb2c3b538298f650e4d1dfb522d52de31de9be645 (diff)
downloaddimension-c150be9eb7e0d69def245d877bd66f6df87f58a1.tar.xz
Get Dimension working on Android.android
Diffstat (limited to 'libdimension/future.c')
-rw-r--r--libdimension/future.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/libdimension/future.c b/libdimension/future.c
index c328815..437b490 100644
--- a/libdimension/future.c
+++ b/libdimension/future.c
@@ -1,5 +1,5 @@
/*************************************************************************
- * Copyright (C) 2009-2011 Tavian Barnes <tavianator@tavianator.com> *
+ * Copyright (C) 2009-2012 Tavian Barnes <tavianator@tavianator.com> *
* *
* This file is part of The Dimension Library. *
* *
@@ -61,7 +61,7 @@ dmnsn_future_join(dmnsn_future *future)
if (future) {
/* Get the thread's return value */
dmnsn_join_thread(future->thread, &ptr);
- if (ptr && ptr != PTHREAD_CANCELED) {
+ if (ptr) {
retval = *(int *)ptr;
dmnsn_free(ptr);
}
@@ -89,7 +89,7 @@ dmnsn_future_join(dmnsn_future *future)
void
dmnsn_future_cancel(dmnsn_future *future)
{
- pthread_cancel(future->thread);
+ dmnsn_error("Thread cancellation not supported on Android.");
}
/* Get the current progress of the worker thread, in [0.0, 1.0] */
@@ -133,11 +133,6 @@ dmnsn_future_set_total(dmnsn_future *future, size_t total)
void
dmnsn_future_increment(dmnsn_future *future)
{
- /* Allow a thread to be canceled whenever it increments a future object --
- this is close to PTHREAD_CANCEL_ASYNCHRONOUS but allows consistent state
- on cancellation */
- pthread_testcancel();
-
dmnsn_write_lock(future->rwlock);
++future->progress;
dmnsn_unlock_rwlock(future->rwlock);