From a842f979c219ef245b09c4607aacc36fbca3f66b Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Tue, 19 Mar 2013 19:44:44 -0400 Subject: Simplify future implementation. A read-write lock was a bad idea, as most consumers are probably writers, not readers. --- libdimension/future-impl.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'libdimension/future-impl.h') 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 * + * Copyright (C) 2010-2013 Tavian Barnes * * * * 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; -- cgit v1.2.3