Browse Source
The file writer thread could get into a state where it blocked infinitely on pthread_cond_wait() (or rather until the logging stops). This is very rare and the following conditions must be met: - the buffer is almost empty (<4KB filled), so that the writer thread does not write anything. - an fsync call is scheduled (happens once every second) - the fsync call takes a long time (several 100ms), during which time the complete log buffer fills up. The main thread would then get into dropout state where it does not call _writer.notify() anymore. Notifying the writer thread on every loop update of the main thread fixes that. It does not increase resource usage.sbg
1 changed files with 3 additions and 11 deletions
Loading…
Reference in new issue