1 # Multi-Processing-safe monkey patch for Logger
3 # This monkey patch fixes the case where "preload_app true" is used and
4 # the application spawns a background thread upon being loaded.
6 # This removes all lock from the Logger code and solely relies on the
7 # underlying filesystem to handle write(2) system calls atomically when
8 # O_APPEND is used. This is safe in the presence of both multiple
9 # threads (native or green) and multiple processes when writing to
10 # a filesystem with POSIX O_APPEND semantics.
12 # It should be noted that the original locking on Logger could _never_ be
13 # considered reliable on non-POSIX filesystems with multiple processes,
14 # either, so nothing is lost in that case.
17 class Logger::LogDevice
19 @dev.syswrite(message)