feat(logs): add `sentry__logs_force_flush` on calling `sentry_flush` by JoshuaMoelans · Pull Request #1434 · getsentry/sentry-native

Fixes #1425

Adds a forced flush call in sentry_flush.

Details

We wait on in-progress flushes by doing

while (sentry__atomic_fetch(&g_logs_state.flushing)) {
    sentry__cpu_relax();
}

Since otherwise, we could be actively flushing from the batching thread & logs might have already been written to the secondary buffer, which we would then not be flushing with the force_flush since flushing was true (-> early exit from the flush_queue function)