From d2719e312fd8c50cbe301c8af7bac2acb5f7b175 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Wed, 23 Oct 2013 20:38:15 +1100 Subject: [PATCH] Implement a cglock_destroy function. --- miner.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/miner.h b/miner.h index e29fb78a..4e3b5a17 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) {