Re: [Swingosc-devel] "failed to start" message
Brought to you by:
sciss
From: James H. <jam...@gm...> - 2010-06-20 06:04:55
|
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 |