59 activeMessage->shouldDeliver.set (0);
66 JUCE_ASSERT_MESSAGE_MANAGER_EXISTS
68 if (activeMessage->shouldDeliver.compareAndSetBool (1, 0))
69 if (! activeMessage->post())
76 activeMessage->shouldDeliver.set (0);
82 JUCE_ASSERT_MESSAGE_MANAGER_IS_LOCKED
84 if (activeMessage->shouldDeliver.exchange (0) != 0)
90 return activeMessage->shouldDeliver.value != 0;
AsyncUpdater()
Creates an AsyncUpdater object.
void triggerAsyncUpdate()
Causes the callback to be triggered at a later time.
void handleUpdateNowIfNeeded()
If an update has been triggered and is pending, this will invoke it synchronously.
bool isUpdatePending() const noexcept
Returns true if there's an update callback in the pipeline.
A message that invokes a callback method when it gets delivered.
Has a callback method that is triggered asynchronously.
void cancelPendingUpdate() noexcept
This will stop any pending updates from happening.
void messageCallback() override
Called when the message is delivered.
virtual void handleAsyncUpdate()=0
Called back to do whatever your class needs to do.
virtual ~AsyncUpdater()
Destructor.
bool compareAndSetBool(Type newValue, Type valueToCompare) noexcept
Atomically compares this value with a target value, and if it is equal, sets this to be equal to a ne...
static MessageManager * getInstanceWithoutCreating() noexcept
Returns the global instance of the MessageManager, or nullptr if it doesn't exist.