[chuck-users] Stopping and restart shreds

Ollie Glass ollieglaskovik at gmail.com
Sat Jul 22 13:10:48 EDT 2006


I'd like to use functions to stop and restart shreds. Is this the  
right way to do it? It doesn't seem to be working properly - I get  
errors from some shreds when I thought they'd all stopped.

Shred shredA, shredB;

fun void sporkAll() {
	spork ~ funA() @=> shredA;
	spork ~ funB() @=> shredB;
	me.yield();
}

fun void killAllShreds() {
	shredA.exit();
	shredB.exit();
	me.yield();
}

Ollie


More information about the chuck-users mailing list