Sha256: f1ecc0fdd9d97d948dc16aba06a037b26e27ba036e18c1be097f771d6e61864a

Contents?: true

Size: 822 Bytes

Versions: 4

Compression:

Stored size: 822 Bytes

Contents

# Copyright (C) 2013 10gen Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

#:nodoc:
module Mongo
  module ThreadLocalVariableManager
    def thread_local
      Thread.current[:mongo_thread_locals] ||= Hash.new do |hash, key|
        hash[key] = Hash.new unless hash.key? key
        hash[key]
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mongo-1.9.2 lib/mongo/util/thread_local_variable_manager.rb
mongo-1.9.1 lib/mongo/util/thread_local_variable_manager.rb
mongo-1.9.1.rc0 lib/mongo/util/thread_local_variable_manager.rb
mongo-1.9.0 lib/mongo/util/thread_local_variable_manager.rb