Sha256: f0815a5da75d7f3c6f5936b0804568ccc15b01cb96f0371a4a40d9ff432a16f9
Contents?: true
Size: 498 Bytes
Versions: 27
Compression:
Stored size: 498 Bytes
Contents
# frozen_string_literal: true module Checkoff module Internal # Manage thread lock variables in a block class ThreadLocal # @sg-ignore # @param name [Symbol] # @param value [Object,Boolean] # # @return [Object,Boolean] def with_thread_local_variable(name, value, &block) old_value = Thread.current[name] Thread.current[name] = value block.yield ensure Thread.current[name] = old_value end end end end
Version data entries
27 entries across 27 versions & 1 rubygems