diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2013-03-19 19:44:44 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2013-03-19 19:51:44 -0400 |
commit | a842f979c219ef245b09c4607aacc36fbca3f66b (patch) | |
tree | 644b5db03f4cce676f0aac49714b766ab8fed74b /libdimension/future-impl.h | |
parent | e597ca66bebb5ef62d3aac6ee832e5ccc811454d (diff) | |
download | dimension-a842f979c219ef245b09c4607aacc36fbca3f66b.tar.xz |
Simplify future implementation.
A read-write lock was a bad idea, as most consumers are probably
writers, not readers.
Diffstat (limited to 'libdimension/future-impl.h')
-rw-r--r-- | libdimension/future-impl.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libdimension/future-impl.h b/libdimension/future-impl.h index c25a7c2..953d5a4 100644 --- a/libdimension/future-impl.h +++ b/libdimension/future-impl.h @@ -1,5 +1,5 @@ /************************************************************************* - * Copyright (C) 2010-2011 Tavian Barnes <tavianator@tavianator.com> * + * Copyright (C) 2010-2013 Tavian Barnes <tavianator@tavianator.com> * * * * This file is part of The Dimension Library. * * * @@ -42,12 +42,11 @@ struct dmnsn_future { /** The worker thread. */ pthread_t thread; - /** Read-write synchronization. */ - pthread_rwlock_t *rwlock; + /** Mutex to guard progress and total. */ + pthread_mutex_t *mutex; /** Condition variable for waiting for a particular amount of progress. */ pthread_cond_t *cond; - pthread_mutex_t *mutex; /** Minimum waited-on value. */ double *min_wait; |