1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-30 02:50:05 +00:00
This commit is contained in:
jules 2008-06-03 13:03:52 +00:00
parent 08e0f81b54
commit 336f5fa85c
2 changed files with 7 additions and 1 deletions

View file

@ -66,7 +66,10 @@ bool ThreadWithProgressWindow::runThread (const int priority)
startThread (priority);
startTimer (100);
alertWindow.setMessage (message);
{
const ScopedLock sl (messageLock);
alertWindow.setMessage (message);
}
const bool wasCancelled = alertWindow.runModalLoop() != 0;
@ -84,6 +87,7 @@ void ThreadWithProgressWindow::setProgress (const double newProgress)
void ThreadWithProgressWindow::setStatusMessage (const String& newStatusMessage)
{
const ScopedLock sl (messageLock);
message = newStatusMessage;
}
@ -97,6 +101,7 @@ void ThreadWithProgressWindow::timerCallback()
}
else
{
const ScopedLock sl (messageLock);
alertWindow.setMessage (message);
}
}

View file

@ -155,6 +155,7 @@ private:
double progress;
AlertWindow alertWindow;
String message;
CriticalSection messageLock;
const int timeOutMsWhenCancelling;
ThreadWithProgressWindow (const ThreadWithProgressWindow&);