diff options
Diffstat (limited to 'libdimension/future.c')
-rw-r--r-- | libdimension/future.c | 11 |
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); |