+void LocalWriter::flush(void) {
+ /*
+ * Do nothing if the mutex is already acquired (e.g., if a segfault happen
+ * while writing the file) to prevent dead-lock.
+ */
+
+ if (!acquired) {
+ OS::AcquireMutex();
+ if (m_file->isOpened()) {
+ m_file->flush();
+ }
+ OS::ReleaseMutex();
+ }
+}
+
+
+LocalWriter localWriter;
+