Sha256: 1a8a92943e0163cc8d496ea5c86bbed10ebc1dd74c92746a050616f557bedd8d

Contents?: true

Size: 1.49 KB

Versions: 35

Compression:

Stored size: 1.49 KB

Contents

# # 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

  # See Mutex#lock
  #
  def mu_lock: () -> Thread::Mutex

  # See Mutex#locked?
  #
  def mu_locked?: () -> bool

  # See Mutex#synchronize
  #
  def mu_synchronize: [T] () { () -> T } -> T

  # See Mutex#try_lock
  #
  def mu_try_lock: () -> bool

  # See Mutex#unlock
  #
  def mu_unlock: () -> Thread::Mutex

  # See 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

35 entries across 35 versions & 1 rubygems

Version Path
rbs-0.15.0 stdlib/mutex_m/mutex_m.rbs
rbs-0.14.0 stdlib/mutex_m/mutex_m.rbs
rbs-0.13.1 stdlib/mutex_m/mutex_m.rbs
rbs-0.13.0 stdlib/mutex_m/mutex_m.rbs
rbs-0.12.2 stdlib/mutex_m/mutex_m.rbs
rbs-0.12.1 stdlib/mutex_m/mutex_m.rbs
rbs-0.12.0 stdlib/mutex_m/mutex_m.rbs
rbs-0.11.0 stdlib/mutex_m/mutex_m.rbs
rbs-0.10.0 stdlib/mutex_m/mutex_m.rbs
rbs-0.9.1 stdlib/mutex_m/mutex_m.rbs
rbs-0.9.0 stdlib/mutex_m/mutex_m.rbs
rbs-0.8.0 stdlib/mutex_m/mutex_m.rbs
rbs-0.7.0 stdlib/mutex_m/mutex_m.rbs
rbs-0.6.0 stdlib/mutex_m/mutex_m.rbs
rbs-0.5.0 stdlib/mutex_m/mutex_m.rbs