I found out that running() always return the value 0, doesn't
matter if the shred is actually running or not. done() instead
seems to work fine.
I tried on my Linux machine running Ubuntu Studio 16.04 using
ChucK 1.4.0.0.
Here's a little script that shows the issue:
0 => int c;
spork ~ loop() @=> Shred parallel;
//---------MAIN---------
while( c < 5 )
{
<<< "running(): " + parallel.running() + "\t||\t " +
"done(): " + parallel.done() >>>;
if( c == 2 )
{
<<< "exiting the shred" >>>;
parallel.exit();
}
c++;
0.5::second => now;
}
//-------FUNCTIONS--------
function void loop()
{
while( true )
{
333::ms => now;
}
}
Cheers,
Mario
-- Electronic Musician, Creative Coder, QA Engineer https://vimeo.com/creativecodingsalerno http://mbuoninfante.tumblr.com/ https://github.com/mariobuoninfante https://bitbucket.org/mariobuoninfante/