summaryrefslogtreecommitdiffstats
path: root/libdimension/future-impl.h
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2013-03-22 21:41:45 -0400
committerTavian Barnes <tavianator@tavianator.com>2013-03-22 21:41:45 -0400
commitc324c3a9e7558e87ec628d45d3d0577d614ee350 (patch)
treec175f3e81fa765a571f82566decc8f54af0b548a /libdimension/future-impl.h
parent62fac6e15e51422a544de01ce6cb01b0921a6706 (diff)
downloaddimension-c324c3a9e7558e87ec628d45d3d0577d614ee350.tar.xz
Use spinlock for futures when possible.faster-futures
Diffstat (limited to 'libdimension/future-impl.h')
-rw-r--r--libdimension/future-impl.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/libdimension/future-impl.h b/libdimension/future-impl.h
index 4ec6f75..c8e5d63 100644
--- a/libdimension/future-impl.h
+++ b/libdimension/future-impl.h
@@ -42,6 +42,11 @@ struct dmnsn_future {
/** The worker thread. */
pthread_t thread;
+#if DMNSN_SPINLOCK
+ /** If spinlocks are supported, use them instead of mutexes. */
+ pthread_spinlock_t spinlock;
+#endif
+
/** Mutex to guard progress and total. */
pthread_mutex_t mutex;