summaryrefslogtreecommitdiffstats
path: root/libdimension-python
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2014-04-26 15:08:09 -0400
committerTavian Barnes <tavianator@tavianator.com>2014-04-26 15:08:09 -0400
commit12c4a5eb07f346083a59bc7d18567b2df3ed94ee (patch)
tree638017b057b81d34935048d1b4c4bb7472614d88 /libdimension-python
parent0acff566213fdddbc8f4561887aced121f82dc26 (diff)
downloaddimension-12c4a5eb07f346083a59bc7d18567b2df3ed94ee.tar.xz
future: Add a dmnsn_future_is_done() function.
Diffstat (limited to 'libdimension-python')
-rw-r--r--libdimension-python/dimension.pxd1
-rw-r--r--libdimension-python/dimension.pyx3
2 files changed, 4 insertions, 0 deletions
diff --git a/libdimension-python/dimension.pxd b/libdimension-python/dimension.pxd
index 4df0786..fb02fbd 100644
--- a/libdimension-python/dimension.pxd
+++ b/libdimension-python/dimension.pxd
@@ -72,6 +72,7 @@ cdef extern from "../libdimension/dimension.h":
int dmnsn_future_join(dmnsn_future *future) nogil
void dmnsn_future_cancel(dmnsn_future *future)
double dmnsn_future_progress(dmnsn_future *future)
+ bint dmnsn_future_is_done(dmnsn_future *future)
void dmnsn_future_wait(dmnsn_future *future, double progress) nogil
void dmnsn_future_pause(dmnsn_future *future) nogil
void dmnsn_future_resume(dmnsn_future *future)
diff --git a/libdimension-python/dimension.pyx b/libdimension-python/dimension.pyx
index 7b6619f..98fc41d 100644
--- a/libdimension-python/dimension.pyx
+++ b/libdimension-python/dimension.pyx
@@ -85,6 +85,9 @@ cdef class Future:
def progress(self):
self._assert_unfinished()
return dmnsn_future_progress(self._future)
+ def is_done(self):
+ self._assert_unfinished()
+ return dmnsn_future_is_done(self._future)
def wait(self, double progress):
self._assert_unfinished()