49 const ScopedLock sl1 (listLock);
53 if (clientBeingCalled == client)
55 const ScopedUnlock ul (listLock);
57 const ScopedLock sl2 (callbackLock);
58 const ScopedLock sl3 (listLock);
60 clients.removeFirstMatchingValue (client);
64 clients.removeFirstMatchingValue (client);
134 int timeToWait = 500;
141 const ScopedLock sl2 (listLock);
143 numClients = clients.size();
144 index = numClients > 0 ? ((index + 1) % numClients) : 0;
146 if (
auto* firstClient = getNextClient (index))
147 nextClientTime = firstClient->nextCallTime;
154 if (nextClientTime > now)
156 timeToWait = (int) jmin ((int64) 500, (nextClientTime - now).inMilliseconds());
160 timeToWait = index == 0 ? 1 : 0;
162 const ScopedLock sl (callbackLock);
165 const ScopedLock sl2 (listLock);
166 clientBeingCalled = getNextClient (index);
169 if (clientBeingCalled !=
nullptr)
171 const int msUntilNextCall = clientBeingCalled->useTimeSlice();
173 const ScopedLock sl2 (listLock);
175 if (msUntilNextCall >= 0)
178 clients.removeFirstMatchingValue (clientBeingCalled);
180 clientBeingCalled =
nullptr;