Skip to content

Commit 7866581

Browse files
committed
[[ Engine ]] Add MCNotifyPending predicate
This patch adds MCNotifyPending() which returns true if there is a notification waiting to be processed.
1 parent b7c59e2 commit 7866581

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

engine/src/notify.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,3 +547,8 @@ void MCNotifyPing(bool p_high_priority)
547547
#error Threading API not specified
548548
#endif
549549
}
550+
551+
bool MCNotifyPending(void)
552+
{
553+
return s_notifications != nil || s_safe_notifications != nil;
554+
}

engine/src/notify.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,7 @@ bool MCNotifyDispatch(bool safe);
3434
// MW-2013-06-14: [[ DesktopPingWait ]] Wake up any currently running 'wait'.
3535
void MCNotifyPing(bool p_high_priority);
3636

37+
// Returns true if there is a pending notification
38+
bool MCNotifyPending(void);
39+
3740
#endif

0 commit comments

Comments
 (0)