mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-09 23:34:20 +00:00
Fixed a data race in ThreadedAnalyticsDestination
This commit is contained in:
parent
2367d648f4
commit
60d52182bb
1 changed files with 2 additions and 2 deletions
|
|
@ -89,6 +89,8 @@ void ThreadedAnalyticsDestination::EventDispatcher::run()
|
|||
while (! threadShouldExit())
|
||||
{
|
||||
{
|
||||
const ScopedLock lock (queueAccess);
|
||||
|
||||
const auto numEventsInBatch = eventsToSend.size();
|
||||
const auto freeBatchCapacity = maxBatchSize - numEventsInBatch;
|
||||
|
||||
|
|
@ -98,8 +100,6 @@ void ThreadedAnalyticsDestination::EventDispatcher::run()
|
|||
|
||||
if (numNewEvents > 0)
|
||||
{
|
||||
const ScopedLock lock (queueAccess);
|
||||
|
||||
const auto numEventsToAdd = jmin (numNewEvents, freeBatchCapacity);
|
||||
const auto newBatchSize = numEventsInBatch + numEventsToAdd;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue