class Thread
def thread_variable_get(key)
for the fiber local. The fiber is executed in the same thread, so the
The value "bar" is returned for the thread local, where +nil+ is returned
}.join.value # => ['bar', nil]
}.resume
]
Thread.current["foo"], # get the fiber local
Thread.current.thread_variable_get("foo"), # get the thread local
Fiber.yield [
Fiber.new {
Thread.current["foo"] = "bar" # set a fiber local
Thread.current.thread_variable_set("foo", "bar") # set a thread local
Thread.new {
fibers. For example:
Thread local values are carried along with threads, and do not respect
these are different than fiber local values.
Returns the value of a thread local variable that has been set. Note that
def thread_variable_get(key) _locals[key.to_sym] end