Sha256: cdff2859f06253063ef4e600b256485c2ac0e79d211ee5d4b711bb0216fe7a69

Contents?: true

Size: 1.99 KB

Versions: 59

Compression:

Stored size: 1.99 KB

Contents

# <!-- rdoc-file=lib/mutex_m.rb -->
# # mutex_m.rb
#
# When 'mutex_m' is required, any object that extends or includes Mutex_m will
# be treated like a Mutex.
#
# Start by requiring the standard library Mutex_m:
#
#     require "mutex_m.rb"
#
# From here you can extend an object with Mutex instance methods:
#
#     obj = Object.new
#     obj.extend Mutex_m
#
# Or mixin Mutex_m into your module to your class inherit Mutex instance methods
# --- remember to call super() in your class initialize method.
#
#     class Foo
#       include Mutex_m
#       def initialize
#         # ...
#         super()
#       end
#       # ...
#     end
#     obj = Foo.new
#     # this obj can be handled like Mutex
#
module Mutex_m
  def self.append_features: (Module cl) -> untyped

  def self.define_aliases: (Module cl) -> untyped

  def self.extend_object: (Object obj) -> untyped

  public

  def mu_extended: () -> untyped

  # <!--
  #   rdoc-file=lib/mutex_m.rb
  #   - mu_lock()
  # -->
  # See Thread::Mutex#lock
  #
  def mu_lock: () -> Thread::Mutex

  # <!--
  #   rdoc-file=lib/mutex_m.rb
  #   - mu_locked?()
  # -->
  # See Thread::Mutex#locked?
  #
  def mu_locked?: () -> bool

  # <!--
  #   rdoc-file=lib/mutex_m.rb
  #   - mu_synchronize(&block)
  # -->
  # See Thread::Mutex#synchronize
  #
  def mu_synchronize: [T] () { () -> T } -> T

  # <!--
  #   rdoc-file=lib/mutex_m.rb
  #   - mu_try_lock()
  # -->
  # See Thread::Mutex#try_lock
  #
  def mu_try_lock: () -> bool

  # <!--
  #   rdoc-file=lib/mutex_m.rb
  #   - mu_unlock()
  # -->
  # See Thread::Mutex#unlock
  #
  def mu_unlock: () -> Thread::Mutex

  # <!--
  #   rdoc-file=lib/mutex_m.rb
  #   - sleep(timeout = nil)
  # -->
  # See Thread::Mutex#sleep
  #
  def sleep: (?Numeric timeout) -> Integer?

  alias locked? mu_locked?

  alias lock mu_lock

  alias unlock mu_unlock

  alias try_lock mu_try_lock

  alias synchronize mu_synchronize

  private

  def initialize: (*untyped args) -> untyped

  def mu_initialize: () -> untyped
end

Mutex_m::VERSION: String

Version data entries

59 entries across 59 versions & 2 rubygems

Version Path
rbs-3.3.0.pre.2 stdlib/mutex_m/0/mutex_m.rbs
rbs-3.3.0.pre.1 stdlib/mutex_m/0/mutex_m.rbs
rbs-3.2.2 stdlib/mutex_m/0/mutex_m.rbs
rbs-3.2.1 stdlib/mutex_m/0/mutex_m.rbs
rbs-3.2.0 stdlib/mutex_m/0/mutex_m.rbs
rbs-3.2.0.pre.1 stdlib/mutex_m/0/mutex_m.rbs
rbs-3.1.3 stdlib/mutex_m/0/mutex_m.rbs
rbs-3.1.2 stdlib/mutex_m/0/mutex_m.rbs
rbs-3.1.1 stdlib/mutex_m/0/mutex_m.rbs
rbs-3.1.0 stdlib/mutex_m/0/mutex_m.rbs
rbs-3.0.4 stdlib/mutex_m/0/mutex_m.rbs
rbs-3.0.3 stdlib/mutex_m/0/mutex_m.rbs
rbs-3.0.2 stdlib/mutex_m/0/mutex_m.rbs
rbs-3.0.1 stdlib/mutex_m/0/mutex_m.rbs
rbs-3.0.0 stdlib/mutex_m/0/mutex_m.rbs
rbs-3.0.0.dev.3 stdlib/mutex_m/0/mutex_m.rbs
rbs-3.0.0.dev.2 stdlib/mutex_m/0/mutex_m.rbs
rbs-2.8.4 stdlib/mutex_m/0/mutex_m.rbs
rbs-2.8.3 stdlib/mutex_m/0/mutex_m.rbs
rbs-3.0.0.dev.1 stdlib/mutex_m/0/mutex_m.rbs