Sha256: 1a2caa37e915fbacd688a7ac9be0027ef0c342a0d6a10772dde97d1bebecde0e

Contents?: true

Size: 296 Bytes

Versions: 50

Compression:

Stored size: 296 Bytes

Contents

module Rack
  class Lock
    FLAG = 'rack.multithread'.freeze

    def initialize(app, lock = Mutex.new)
      @app, @lock = app, lock
    end

    def call(env)
      old, env[FLAG] = env[FLAG], false
      @lock.synchronize { @app.call(env) }
    ensure
      env[FLAG] = old
    end
  end
end

Version data entries

50 entries across 49 versions & 16 rubygems

Version Path
kjvarga-rack-1.0.0 lib/rack/lock.rb
qoobaa-rack-1.0.0.1 lib/rack/lock.rb
qoobaa-rack-1.0.2 lib/rack/lock.rb
timocratic-rack-1.0.0 lib/rack/lock.rb
rack-1.1.6 lib/rack/lock.rb
rack-1.1.5 lib/rack/lock.rb
rack-1.1.4 lib/rack/lock.rb
radiant-1.0.0 ruby-debug/ruby/1.8/gems/rack-1.1.3/lib/rack/lock.rb
rack-1.1.3 lib/rack/lock.rb
vanity-1.7.1 vendor/ruby/1.9.1/gems/rack-1.1.2/lib/rack/lock.rb
rack-1.2.4 lib/rack/lock.rb
rack-1.2.3 lib/rack/lock.rb
rack-1.2.2 lib/rack/lock.rb
rack-1.1.2 lib/rack/lock.rb
rack-1.1.1 lib/rack/lock.rb
rack-1.1.1.pre lib/rack/lock.rb
eac-rack-1.1.1 lib/rack/lock.rb
rack-1.2.1 lib/rack/lock.rb
rack-1.2.0 lib/rack/lock.rb
akamai_bookmarklet-0.1.2 vendor/gems/ruby/1.8/gems/rack-1.1.0/lib/rack/lock.rb