Commit d2719e312fd8c50cbe301c8af7bac2acb5f7b175

Con Kolivas 2013-10-23T20:38:15

Implement a cglock_destroy function.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/miner.h b/miner.h
index e29fb78..4e3b5a1 100644
--- a/miner.h
+++ b/miner.h
@@ -910,6 +910,12 @@ static inline void _cglock_init(cglock_t *lock, const char *file, const char *fu
 	_rwlock_init(&lock->rwlock, file, func, line);
 }
 
+static inline void cglock_destroy(cglock_t *lock)
+{
+	rwlock_destroy(&lock->rwlock);
+	mutex_destroy(&lock->mutex);
+}
+
 /* Read lock variant of cglock. Cannot be promoted. */
 static inline void _cg_rlock(cglock_t *lock, const char *file, const char *func, const int line)
 {