Skip to content

Commit dec35d8

Browse files
committed
Always store in capture buffer, dropping oldest
1 parent cf9239a commit dec35d8

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

source/TS.NET/Memory/CaptureCircularBuffer.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,14 @@ public bool TryStartWrite()
131131
}
132132
internalIntervalCaptureTotal++;
133133

134-
if (currentCaptureCount == maxCaptureCount)
134+
lock(readLock)
135135
{
136-
captureDrops++;
137-
intervalCaptureDrops++;
138-
return false;
136+
if (currentCaptureCount == maxCaptureCount)
137+
{
138+
captureDrops++;
139+
intervalCaptureDrops++;
140+
FinishRead(); // Remove oldest buffer
141+
}
139142
}
140143
writeInProgress = true;
141144
return true;

0 commit comments

Comments
 (0)