~ubuntu-branches/ubuntu/trusty/musl/trusty-proposed

« back to all changes in this revision

Viewing changes to src/thread/pthread_barrier_destroy.c

  • Committer: Package Import Robot
  • Author(s): Kevin Bortis
  • Date: 2013-09-20 20:54:14 UTC
  • Revision ID: package-import@ubuntu.com-20130920205414-5b61trtmma18w58o
Tags: upstream-0.9.13
ImportĀ upstreamĀ versionĀ 0.9.13

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "pthread_impl.h"
 
2
 
 
3
void __vm_lock(int), __vm_unlock(void);
 
4
 
 
5
int pthread_barrier_destroy(pthread_barrier_t *b)
 
6
{
 
7
        if (b->_b_limit < 0) {
 
8
                if (b->_b_lock) {
 
9
                        int v;
 
10
                        a_or(&b->_b_lock, INT_MIN);
 
11
                        while ((v = b->_b_lock) & INT_MAX)
 
12
                                __wait(&b->_b_lock, 0, v, 0);
 
13
                }
 
14
                __vm_lock(-1);
 
15
                __vm_unlock();
 
16
        }
 
17
        return 0;
 
18
}