[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] AppClock.clear? (was Button action not freeing synth)



Or, it occurred to me later, you could use a flag along with the function.

~r1yield = 1;
AppClock.sched(0, { "foo".postln; ~r1yield });

// to stop
// note, DO NOT set this to zero unless you like the spinning beachball
~r1yield = nil;

But I think a routine is better, since it's an actual Thread whereas a function is something else. (I wouldn't mind it if functions would not reschedule themselves after returning a number, but it is what it is... backward compatibility...)

hjh


On Apr 30, 2009, at 11:40 AM, James Harkins wrote:

Better to use Routines rather than functions.

AppClock.sched(0, a = Routine { loop { "foo".postln; 1.yield; } } );
a.stop;

hjh

On Thu, Apr 30, 2009 at 11:32 AM, Scott Worthington <stwbass@xxxxxxxxx> wrote:


Keep track of your threads and stop them individually.
hjh

I'm not sure how to do this. My first thought was

AppClock.sched(0, a = {"foo".postln; 1} );
a.stop


: H. James Harkins
.::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..:

"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal."  -- Whitman