Module: LLM::Lock
- Defined in:
- lib/llm/lock.rb
Overview
The Lock module provides named
locks that are globally accessible and
only usable from Ractor.main. The module
will noop when given any other Ractor other
than main.
Class Method Summary collapse
-
.synchronize(name, &block)
Provides a thread-safe lock.
Class Method Details
.synchronize(name, &block)
This method returns an undefined value.
Provides a thread-safe lock
26 27 28 29 30 31 32 |
# File 'lib/llm/lock.rb', line 26 def self.synchronize(name, &block) if Ractor.main? @monitors[name].synchronize(&block) else nil end end |