Sha256: 95710ff90335a9da7461dd0342bf17e885292de7bb246953875dfbf77596d5c9
Contents?: true
Size: 298 Bytes
Versions: 4
Compression:
Stored size: 298 Bytes
Contents
require 'thread' require 'fcntl' module Hydra class ThreadsafeIO < IO def initialize(existing_io) fd = existing_io.fcntl(Fcntl::F_DUPFD) super(fd) @mutex = Mutex.new end def write(*args) @mutex.synchronize do super(*args) end end end end
Version data entries
4 entries across 4 versions & 3 rubygems