void Gsp1101::run() { double prog = 0.0; AlertWindow* alertWindow; { const MessageManagerLock mml ;//(Thread::getCurrentThread()); alertWindow = LookAndFeel::getDefaultLookAndFeel() .createAlertWindow ("title", String::empty, String::empty, String::empty, String::empty, AlertWindow::NoIcon, 0, 0); alertWindow->addProgressBarComponent (prog); alertWindow->setMessage ("foo"); alertWindow->setVisible (true); } while (!threadShouldExit() && lastMidiInput_M.getSize() < 1) { wait(200); const MessageManagerLock mml (Thread::getCurrentThread()); if (! mml.lockWasGained()) // if something is trying to kill this job, the lock return; // will fail, in which case we'd better return.. prog = (prog > 1.0) ? 0.0 : prog + 0.1; yield(); //Thread::sleep(200); } const MessageManagerLock mml (Thread::getCurrentThread()); alertWindow->setVisible (false); }