mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
TimeSliceThread: Add function to check whether a certain job is still registered
This commit is contained in:
parent
7aa3bfdc93
commit
b70b7a309d
2 changed files with 10 additions and 0 deletions
|
|
@ -89,6 +89,7 @@ void TimeSliceThread::moveToFrontOfQueue (TimeSliceClient* client)
|
|||
|
||||
int TimeSliceThread::getNumClients() const
|
||||
{
|
||||
const ScopedLock sl (listLock);
|
||||
return clients.size();
|
||||
}
|
||||
|
||||
|
|
@ -98,6 +99,12 @@ TimeSliceClient* TimeSliceThread::getClient (const int i) const
|
|||
return clients[i];
|
||||
}
|
||||
|
||||
bool TimeSliceThread::contains (const TimeSliceClient* c) const
|
||||
{
|
||||
const ScopedLock sl (listLock);
|
||||
return std::any_of (clients.begin(), clients.end(), [=] (auto* registered) { return registered == c; });
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
TimeSliceClient* TimeSliceThread::getNextClient (int index) const
|
||||
{
|
||||
|
|
|
|||
|
|
@ -131,6 +131,9 @@ public:
|
|||
/** Returns one of the registered clients. */
|
||||
TimeSliceClient* getClient (int index) const;
|
||||
|
||||
/** Returns true if the client is currently registered. */
|
||||
bool contains (const TimeSliceClient*) const;
|
||||
|
||||
//==============================================================================
|
||||
#ifndef DOXYGEN
|
||||
void run() override;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue