summaryrefslogtreecommitdiffstats
path: root/libdimension-python/wrapper.pyx
diff options
context:
space:
mode:
Diffstat (limited to 'libdimension-python/wrapper.pyx')
-rw-r--r--libdimension-python/wrapper.pyx8
1 files changed, 6 insertions, 2 deletions
diff --git a/libdimension-python/wrapper.pyx b/libdimension-python/wrapper.pyx
index 738a63f..1afb0ea 100644
--- a/libdimension-python/wrapper.pyx
+++ b/libdimension-python/wrapper.pyx
@@ -67,8 +67,11 @@ cdef class Future:
def join(self):
self._assert_unfinished()
+ cdef int retcode
try:
- if dmnsn_future_join(self._future) != 0:
+ with nogil:
+ retcode = dmnsn_future_join(self._future)
+ if retcode != 0:
raise RuntimeError("background task failed.")
if self._finalizer is not None:
self._finalizer()
@@ -85,7 +88,8 @@ cdef class Future:
def wait(self, progress):
self._assert_unfinished()
- dmnsn_future_wait(self._future, progress)
+ with nogil:
+ dmnsn_future_wait(self._future, progress)
def _assert_unfinished(self):
if self._future == NULL: