mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-26 18:42:41 +01:00
Added NotificationQueue::remove function
This includes appropriate tests, which pass on my Mac 10.4 machine
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user