module Mutex_m
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
Public Class Methods
(Module cl) → untyped
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/mutex_m/0/mutex_m.rbs, line 31
def self.append_features: (Module cl) -> untyped
(Module cl) → untyped
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/mutex_m/0/mutex_m.rbs, line 33
def self.define_aliases: (Module cl) -> untyped
(Object obj) → untyped
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/mutex_m/0/mutex_m.rbs, line 35
def self.extend_object: (Object obj) -> untyped
(*untyped args) → untyped
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/mutex_m/0/mutex_m.rbs, line 99
def initialize: (*untyped args) -> untyped
Public Instance Methods
() → untyped
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/mutex_m/0/mutex_m.rbs, line 37
def mu_extended: () -> untyped
() → untyped
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/mutex_m/0/mutex_m.rbs, line 101
def mu_initialize: () -> untyped
() → Thread::Mutex
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/mutex_m/0/mutex_m.rbs, line 45
def mu_lock: () -> Thread::Mutex
Also aliased as: lock
() → bool
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/mutex_m/0/mutex_m.rbs, line 53
def mu_locked?: () -> bool
Also aliased as: locked?
[T] () { () → T } → T
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/mutex_m/0/mutex_m.rbs, line 61
def mu_synchronize: [T] () { () -> T } -> T
Also aliased as: synchronize
() → bool
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/mutex_m/0/mutex_m.rbs, line 69
def mu_try_lock: () -> bool
Also aliased as: try_lock
() → Thread::Mutex
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/mutex_m/0/mutex_m.rbs, line 77
def mu_unlock: () -> Thread::Mutex
Also aliased as: unlock
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/mutex_m/0/mutex_m.rbs, line 85
def sleep: (?Numeric timeout) -> Integer?
See Thread::Mutex#sleep