All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jruby.kernel.prelude.rb Maven / Gradle / Ivy

There is a newer version: 9.4.12.0
Show newest version
class Thread
  MUTEX_FOR_THREAD_EXCLUSIVE = Mutex.new # :nodoc:

  # call-seq:
  #    Thread.exclusive { block }   => obj
  #
  # Wraps the block in a single, VM-global Mutex.synchronize, returning the
  # value of the block. A thread executing inside the exclusive section will
  # only block other threads which also use the Thread.exclusive mechanism.
  def self.exclusive
    warn "Thread.exclusive is deprecated, use Mutex", caller
    MUTEX_FOR_THREAD_EXCLUSIVE.synchronize{
      yield
    }
  end
end




© 2015 - 2025 Weber Informatics LLC | Privacy Policy