1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Changed MessageBase::post() to return a bool to detect failure in the OS message queue (which can happen under stress on win32), and used this to avoid some messaging classes getting stuck.

This commit is contained in:
jules 2014-07-16 21:33:11 +01:00
parent 8baa07ac89
commit 7b8ab7b503
3 changed files with 22 additions and 7 deletions

View file

@ -61,7 +61,9 @@ AsyncUpdater::~AsyncUpdater()
void AsyncUpdater::triggerAsyncUpdate()
{
if (activeMessage->shouldDeliver.compareAndSetBool (1, 0))
activeMessage->post();
if (! activeMessage->post())
cancelPendingUpdate(); // if the message queue fails, this avoids getting
// trapped waiting for the message to arrive
}
void AsyncUpdater::cancelPendingUpdate() noexcept