daveconor 1 Posted August 24, 2013 Report Share Posted August 24, 2013 (edited) Im trying to have four buttons each controlling the pausing and unpausing of a particular open thread. Here's what I've got so far: Using 4 threads Each ui button has a different variable for pause: #pause1, #pause2, #pause3, #pause4 There is a thread counter that assigns each thread a number ( 1 - 4 and then resets back to one ) which is then set locally within the thread, with that I set that thread to work with its corresponding #pause number and button. if($comparison(#thread number, "=", 1)) { then { loop while($comparison(#pause1, "=", "Pause")) { wait(1) } } } Problem: say I let all 4 threads open completely and now I want to unpause thread #4, well I better not, because at that point the counter is on 4 and if I close 4, the next thread will receive a number value of 1 from the counter thus replacing the thread corresponding with button #1 before I had the chance to complete the first #1 thread in the first place. It only works if I go in order 1,2,3,4,1,2,3... but that's just lame... I'm pretty sure I'm going about this the wrong way and would LOVE if anyone could shed some light on it. Thanks Edited August 24, 2013 by daveconor Quote Link to post Share on other sites
the_way 52 Posted August 25, 2013 Report Share Posted August 25, 2013 i would write instead something in that would have each of the threads set to active = true or false. Then a set of if else's to say if thread one is running (true) then thread 2, 3, 4 false. Each time they change, the rules would reset, would that be any help to you? Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.