File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff 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
5659static bool
5760check_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
You can’t perform that action at this time.
0 commit comments