summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/grp.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/grp.cc')
-rw-r--r--winsup/cygwin/grp.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/winsup/cygwin/grp.cc b/winsup/cygwin/grp.cc
index e4a4afd6c..d9e7b02b4 100644
--- a/winsup/cygwin/grp.cc
+++ b/winsup/cygwin/grp.cc
@@ -123,6 +123,11 @@ class group_lock
public:
group_lock (): mutex ((pthread_mutex_t) PTHREAD_MUTEX_INITIALIZER) {}
void arm () {pthread_mutex_lock (&mutex); }
+ ~group_lock ()
+ {
+ if (mutex != (pthread_mutex_t) PTHREAD_MUTEX_INITIALIZER)
+ pthread_mutex_unlock (&mutex);
+ }
};
/* Cygwin internal */