sleepy_penguin.git  about / heads / tags
Linux I/O events for Ruby
blob 808c94a90226cc712a47c437a1a477936d6972c1 464 bytes (raw)
$ git show v3.4.1:lib/sleepy_penguin.rb	# shows this blob on the CLI

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
 
# -*- encoding: binary -*-
require 'sleepy_penguin_ext'

# We need to serialize Inotify#take for Rubinius since that has no GVL
# to protect the internal array
if defined?(SleepyPenguin::Inotify) &&
   defined?(Rubinius) && Rubinius.respond_to?(:synchronize)
  class SleepyPenguin::Inotify
    # :stopdoc:
    alias __take take
    undef_method :take
    def take(*args)
      Rubinius.synchronize(@inotify_tmp) { __take(*args) }
    end
    # :startdoc
  end
end

git clone https://yhbt.net/sleepy_penguin.git