From: SASADA Koichi Date: 2012-10-02T08:32:51+09:00 Subject: [ruby-core:47800] Re: [ruby-trunk - Bug #7097][Assigned] Thread locals don't work inside Enumerator (2012/10/02 8:22), SASADA Koichi wrote: > > One idea is: > > - Define: Thread#[] -> Thred#current_fiber#[] > - Add: Thread#truly_thread_local_get(key) > and Thread#truly_thread_local_set(key, val) > > (of course, truly_... is temporal name) Another idea: Add an option to derive Fiber local storage at a Fiber creation. For example: Thread[:foo] = :bar Fiber.new(derive_fiber_local_storage: true) do Thread[:foo] #=> :bar end And use Fiber in enumerator with this option true. -- // SASADA Koichi at atdot dot net