Module: ThreadImmutable
Defined Under Namespace
Modules: ClassMethods
Classes: IllegalCrossThreadMethodCall
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.included(klass) ⇒ Object
147
148
149
|
# File 'lib/wakame/util.rb', line 147
def self.included(klass)
klass.extend ClassMethods
end
|
Instance Method Details
#bind_thread(thread = Thread.current) ⇒ Object
175
176
177
178
|
# File 'lib/wakame/util.rb', line 175
def bind_thread(thread=Thread.current)
@target_thread = thread
end
|
#target_thread ⇒ Object
191
192
193
|
# File 'lib/wakame/util.rb', line 191
def target_thread
@target_thread
end
|
#target_thread?(t = Thread.current) ⇒ Boolean
186
187
188
|
# File 'lib/wakame/util.rb', line 186
def target_thread?(t=Thread.current)
@target_thread == t
end
|
#thread_check ⇒ Object
180
181
182
183
184
|
# File 'lib/wakame/util.rb', line 180
def thread_check
raise "Thread is not bound." if @target_thread.nil?
raise IllegalCrossThreadMethodCall unless target_thread?
end
|