process-shared barrier support, based on discussion with bdonlan
[musl] / src / thread / pthread_barrier_destroy.c
index 2898c41..f82664d 100644 (file)
@@ -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;
 }