Re: [Swingosc-devel] "failed to start" message
Brought to you by:
sciss
From: Sciss <co...@sc...> - 2010-06-21 12:35:57
|
hi james, i had little time to look into this, unfortunately. if Routine:stop is not guarateed to stop the routine, i would say this is a definite case for the SC3 bugtracker. i don't like the Task class, i think it is fundamentally wrongly designed. i suggest as a workaround for now, we just don't call cancel.stop, and instead use another local boolean variable "cancelled" that the updatelistener sets to true, and when the cancel routine is executed, we need an if-clause reading the cancelled state. ok? best, -sciss- Am 20.06.2010 um 07:04 schrieb James Harkins: > I think I see what the problem is. I put in some debugging statements > this morning, and found that the line "cancel.stop" is not guaranteed to > prevent the cancel action from running. > > SwingOSC : server connected. > swing updatelistener: is running: true > stopped cancel thread > > // later: > cancel thread awake > > ^^ Whoa!! That last line shouldn't happen. > > My suggestion, if you don't like the conditional inside 'cancel', is to > use a Task instead of a routine. If it's a Task, "cancel.stop" will set > the task's stream variable to nil. The task remains in the scheduler > queue, but when it wakes up, it looks to 'stream' to know what to do and > finds nothing. > > That is, replace the current 'cancel' assignment with this: > > cancel = Task({ > timeout.wait; > upd.remove; > "SwingOSC server failed to start".error; > serverBooting = false; > }).play(clock); > > hjh > > > // debug statements, for reference > > > doWhenBooted { arg onComplete, timeout = 20.0; > var cancel, upd; > > if( serverRunning.not, { > upd = UpdateListener.newFor( this, { > if( serverRunning.debug("swing updatelistener: is > running"), { > cancel.stop; > "stopped cancel thread".debug; > upd.remove; > fork(onComplete); > }); > }, \serverRunning); > cancel = { > timeout.wait; > "cancel thread awake".debug; > upd.remove; > if(serverRunning.not) { > "SwingOSC server failed to start".error; > }; > serverBooting = false; > }.fork( clock ); > }, { fork(onComplete) }); > } > > > -- > > James Harkins /// dewdrop world > jam...@de... > http://www.dewdrop-world.net > > "Come said the Muse, > Sing me a song no poet has yet chanted, > Sing me the universal." -- Whitman > > blog: http://www.dewdrop-world.net/words > audio clips: http://www.dewdrop-world.net/audio > more audio: http://soundcloud.com/dewdrop_world/tracks > > > ------------------------------------------------------------------------------ > ThinkGeek and WIRED's GeekDad team up for the Ultimate > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > lucky parental unit. See the prize list and enter to win: > http://p.sf.net/sfu/thinkgeek-promo > _______________________________________________ > Swingosc-devel mailing list > Swi...@li... > https://lists.sourceforge.net/lists/listinfo/swingosc-devel |