Sha256: 9b828e70efa9f2bc701b70698e87a219e43d67055d23de2c2d01431694f1da4f
Contents?: true
Size: 835 Bytes
Versions: 144
Compression:
Stored size: 835 Bytes
Contents
# Multi-Processing-safe monkey patch for Logger # # This monkey patch fixes the case where "preload_app true" is used and # the application spawns a background thread upon being loaded. # # This removes all lock from the Logger code and solely relies on the # underlying filesystem to handle write(2) system calls atomically when # O_APPEND is used. This is safe in the presence of both multiple # threads (native or green) and multiple processes when writing to # a filesystem with POSIX O_APPEND semantics. # # It should be noted that the original locking on Logger could _never_ be # considered reliable on non-POSIX filesystems with multiple processes, # either, so nothing is lost in that case. require 'logger' class Logger::LogDevice def write(message) @dev.syswrite(message) end def close @dev.close end end
Version data entries
144 entries across 144 versions & 13 rubygems