Added NotificationQueue::remove function

This includes appropriate tests, which pass on my Mac 10.4 machine
This commit is contained in:
Mazyad Alabduljaleel
2015-08-06 14:13:11 +04:00
parent e438061ce7
commit 5cff648eea
4 changed files with 42 additions and 0 deletions

View File

@@ -179,6 +179,19 @@ void NotificationQueue::clear()
}
bool NotificationQueue::remove(Notification::Ptr pNotification)
{
FastMutex::ScopedLock lock(_mutex);
NfQueue::iterator it = std::find(_nfQueue.begin(), _nfQueue.end(), pNotification);
if (it == _nfQueue.end())
{
return false;
}
_nfQueue.erase(it);
return true;
}
bool NotificationQueue::hasIdleThreads() const
{
FastMutex::ScopedLock lock(_mutex);