Skip to content

Commit c405106

Browse files
committed
add docs
1 parent cdad215 commit c405106

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/sentry_logs.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ static struct {
5353
// checks whether the currently active buffer should be flushed.
5454
// otherwise we could miss the trigger of adding the last log if we're actively
5555
// flushing the other buffer already.
56+
// we can safely check the state of the active buffer, as the only thread that
57+
// can change which buffer is active is the one calling this check function
58+
// inside flush_logs_queue() below
5659
static bool
5760
check_for_flush_condition(void)
5861
{
@@ -61,6 +64,7 @@ check_for_flush_condition(void)
6164
log_buffer_t *current_buf = &g_logs_state.buffers[current_active];
6265

6366
// Check if current active buffer is also full
67+
// We could even lower the threshold for high-contention scenarios
6468
return sentry__atomic_fetch(&current_buf->index) >= QUEUE_LENGTH;
6569
}
6670

0 commit comments

Comments
 (0)