[all-commits] [llvm/llvm-project] 04c307: [Driver] Flush file in locked area

Serge Pavlov via All-commits all-commits at lists.llvm.org
Fri Feb 26 04:04:17 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 04c3071c16d799a4406c1742f239e8381c00b2b8
      https://github.com/llvm/llvm-project/commit/04c3071c16d799a4406c1742f239e8381c00b2b8
  Author: Serge Pavlov <sepavloff at gmail.com>
  Date:   2021-02-26 (Fri, 26 Feb 2021)

  Changed paths:
    M clang/lib/Driver/Driver.cpp

  Log Message:
  -----------
  [Driver] Flush file in locked area

When writing report file by option -proc-stat-report some part of output
can be written to unlocked file because destructor of raw_fd_ostream
calls `flush()`. In high thread contention environment it can result in
file operation failure. With this change `flush` is called explicitly when
file is locked, so call of `flush()` in the destructor does not cause
write to file.




More information about the All-commits mailing list