chiark / gitweb /
changed powers on vertex displacements -- tweaked parameters for XBITS==5
[moebius2.git] / PTHREAD_SCOPE_SYSTEM.patch
1 === modified file 'parallel.c'
2 --- parallel.c  2008-09-28 12:25:57 +0000
3 +++ parallel.c  2008-09-28 12:56:42 +0000
4 @@ -55,6 +55,14 @@
5    int s, r;
6  
7    if (!threads_started) {
8 +    pthread_attr_t tattr;
9 +
10 +    r= pthread_attr_init(&tattr);
11 +    if (r) { errno=r; diee("pthread_attr_init"); }
12 +
13 +    r= pthread_attr_setscope(&tattr, PTHREAD_SCOPE_SYSTEM);
14 +    if (r) { errno=r; diee("pthread_attr_setscope"); }
15 +
16      r= pthread_barrier_init(&threads_barrier, 0, NSECTIONS);
17      if (r) { errno=r; diee("pthread_barrier_init"); }
18  
19 @@ -63,6 +71,9 @@
20        if (r) { errno=r; diee("pthread_create"); }
21      }
22      threads_started= 1;
23 +
24 +    r= pthread_attr_destroy(&tattr);
25 +    if (r) { errno=r; diee("pthread_attr_destroy"); }
26    }    
27  
28    for (s=0; s<NSECTIONS-1; s++) {
29