Changeset 1f55a75 for tests/concurrent


Ignore:
Timestamp:
Mar 23, 2021, 9:19:47 PM (5 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum, stuck-waitfor-destruct
Children:
98d9ce9
Parents:
f9c3100 (diff), e825c9d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

Location:
tests/concurrent
Files:
2 added
1 edited

Legend:

Unmodified
Added
Removed
  • tests/concurrent/clib.c

    rf9c3100 r1f55a75  
    22#include <stdlib.h>
    33#include <clib/cfathread.h>
     4#include <bits/defs.hfa>
    45
    56extern "C" {
     
    6162        cfathread_cluster_add_worker( cl, NULL, NULL, NULL );
    6263        cfathread_cluster_add_worker( cl, NULL, NULL, NULL );
     64
     65        cfathread_attr_t attr;
     66        cfathread_attr_init(&attr);
     67        cfathread_attr_setcluster(&attr, cl);
     68
    6369        cfathread_t u;
    64         cfathread_create( &u, NULL, Unparker, NULL );
     70        cfathread_create( &u, &attr, Unparker, NULL );
    6571        {
    6672                cfathread_t t[20];
    6773                for(int i = 0; i < 20; i++) {
    68                         cfathread_create( &t[i], NULL, Worker, NULL );
     74                        cfathread_create( &t[i], &attr, Worker, NULL );
    6975                }
    7076                for(int i = 0; i < 20; i++) {
     
    7480        stop = true;
    7581        cfathread_join(u, NULL);
     82        cfathread_attr_destroy(&attr);
    7683        fflush(stdout);
    7784        _exit(0);
Note: See TracChangeset for help on using the changeset viewer.