about summary refs log tree commit diff
path: root/src/thread/pthread_barrier_destroy.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/thread/pthread_barrier_destroy.c')
-rw-r--r--src/thread/pthread_barrier_destroy.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/thread/pthread_barrier_destroy.c b/src/thread/pthread_barrier_destroy.c
index 2898c41a..f82664d5 100644
--- a/src/thread/pthread_barrier_destroy.c
+++ b/src/thread/pthread_barrier_destroy.c
@@ -1,6 +1,12 @@
 #include "pthread_impl.h"
 
+void __vm_lock(int), __vm_unlock(void);
+
 int pthread_barrier_destroy(pthread_barrier_t *b)
 {
+	if (b->_b_limit < 0) {
+		__vm_lock(-1);
+		__vm_unlock();
+	}
 	return 0;
 }