Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions core/mutex.rbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
class Mutex
def initialize: () -> void

def lock: () -> self

def unlock: () -> self

def try_lock: () -> bool

def locked?: () -> bool

def owned?: () -> bool
end
13 changes: 13 additions & 0 deletions test/mutex.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# frozen_string_literal: true

mutex = Mutex.new

mutex.lock

mutex.unlock

mutex.try_lock

mutex.locked?

mutex.owned?