Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#170 closed enhancement (fixed)

unpark new thread

Reported by: Thierry Delisle Owned by: Thierry Delisle <tdelisle@…>
Priority: minor Component: libcfa
Version: 1.0 Keywords: Park/Unpark
Cc:

Description

The following code would be convenient to have a bunch of threads "start at once"

thread MyThread { /*...*/ };
void main( MyThread & ) { park(); /*...*/ }

void foo() {
    MyThread mythreads[4];
    for(i; 4) {
        unpark(mythreads[i]);
    }
    /*...*/
}

This could be a little tricky because normally, park and unparks should be perfectly interleaved, but in this case "start, unpark, park" is similar enough to "unpark, unpark, park" that it might cause problems.

Change History (3)

comment:1 by Thierry Delisle <tdelisle@…>, 5 years ago

Owner: set to Thierry Delisle <tdelisle@…>
Resolution: fixed
Status: newclosed

In ff79d5e:

Fixed park unpark to support park as first step of main()
Fixes #170

comment:2 by Thierry Delisle <tdelisle@…>, 5 years ago

In ff79d5e:

Fixed park unpark to support park as first step of main()
Fixes #170

comment:3 by Thierry Delisle <tdelisle@…>, 5 years ago

In ff79d5e:

Fixed park unpark to support park as first step of main()
Fixes #170

Note: See TracTickets for help on using tickets.