View Single Post
  #12 (permalink)  
Old 08-30-2008, 01:18 AM
willemjav willemjav is offline
Senior Member
 
Join Date: Dec 2007
Location: Spain
Posts: 342
willemjav is on a distinguished road
PK your code does not compile

Code:
Boolean midipedalflag; midipedalflag=false; // the flag set by midipedal do { // and space bar synchronized(midipedalflag){ midipedalflag.wait(); } } while (!midipedalflag); midipedalflag=false;
After all the loop of mine is not a very elegant way of doing things, I admit, but at least I ensure that, while spinning in that loop, there is not happening to much more. When the flag is set (or the box unchecked) the thread terminates and the info screen displays ¨pedal pushed¨ .... not much more should happen for the moment. Because that is all, waiting and notifying, is not really needed!? I tested the thing and saw no problem, Sure when more things are involved one should look for other ways!
Reply With Quote