summaryrefslogtreecommitdiffstats
path: root/libdimension
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2014-04-26 15:08:33 -0400
committerTavian Barnes <tavianator@tavianator.com>2014-04-26 18:06:18 -0400
commitbc1ac83133bb32ce3795c4781fd504580ae27d8b (patch)
tree95dd45607ab10d25ca8f3dbadccc76f3a02d1b0d /libdimension
parent12c4a5eb07f346083a59bc7d18567b2df3ed94ee (diff)
downloaddimension-bc1ac83133bb32ce3795c4781fd504580ae27d8b.tar.xz
future.c: Don't let people join futures while they're paused.
Diffstat (limited to 'libdimension')
-rw-r--r--libdimension/future.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libdimension/future.c b/libdimension/future.c
index 622d40e..c344a8e 100644
--- a/libdimension/future.c
+++ b/libdimension/future.c
@@ -63,6 +63,8 @@ dmnsn_future_join(dmnsn_future *future)
int retval = -1;
if (future) {
+ dmnsn_assert(future->npaused == 0, "Attempt to join future while paused");
+
/* Get the thread's return value */
dmnsn_join_thread(future->thread, &ptr);
if (ptr && ptr != PTHREAD_CANCELED) {