Changeset a5e7233 for tests/concurrent


Ignore:
Timestamp:
Mar 17, 2021, 1:56:12 PM (7 months ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
arm-eh, jacob/cs343-translation, master, new-ast-unique-expr
Children:
c407434
Parents:
e0c072c
Message:

C interface now runs worker init routine in dedicated thread.
Also added test for this case.

Location:
tests/concurrent
Files:
2 added
1 edited

Legend:

Unmodified
Added
Removed
  • tests/concurrent/clib.c

    re0c072c ra5e7233  
    6262        cfathread_cluster_add_worker( cl, NULL, NULL, NULL );
    6363        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
    6469        cfathread_t u;
    65         cfathread_create( &u, NULL, Unparker, NULL );
     70        cfathread_create( &u, &attr, Unparker, NULL );
    6671        {
    6772                cfathread_t t[20];
    6873                for(int i = 0; i < 20; i++) {
    69                         cfathread_create( &t[i], NULL, Worker, NULL );
     74                        cfathread_create( &t[i], &attr, Worker, NULL );
    7075                }
    7176                for(int i = 0; i < 20; i++) {
     
    7580        stop = true;
    7681        cfathread_join(u, NULL);
     82        cfathread_attr_destroy(&attr);
    7783        fflush(stdout);
    7884        _exit(0);
Note: See TracChangeset for help on using the changeset viewer.