Commit 6bd5139cfc686c23acc7fc3b398d08d0a6010ff3

Con Kolivas 2013-10-23T20:34:50

Implement a mutex_destroy function.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/miner.h b/miner.h
index 915d7f8..b53497f 100644
--- a/miner.h
+++ b/miner.h
@@ -885,6 +885,13 @@ static inline void _mutex_init(pthread_mutex_t *lock, const char *file, const ch
 	INITLOCK(lock, CGLOCK_MUTEX, file, func, line);
 }
 
+static inline void mutex_destroy(pthread_mutex_t *lock)
+{
+	/* Ignore return code. This only invalidates the mutex on linux but
+	 * releases resources on windows. */
+	pthread_mutex_destroy(lock);
+}
+
 static inline void _rwlock_init(pthread_rwlock_t *lock, const char *file, const char *func, const int line)
 {
 	if (unlikely(pthread_rwlock_init(lock, NULL)))