def push_to_thread_queue(context)
      thread_name = context.respond_to?(:thread_name) ? context.thread_name : ::RightScale::AgentConfig.default_thread_name
      queue = nil
      @mutex.synchronize do
        queue = @thread_name_to_queue[thread_name]
        unless queue
          # continuation for when thread-named queue is finally closed.
          queue = create_thread_queue(thread_name) { push(THREAD_QUEUE_CLOSED_BUNDLE) }
          @thread_name_to_queue[thread_name] = queue
        end
      end

      # push context to selected thread queue
      queue.push(context)

      # always (re)activate in case an individual thread queue died unexpectedly.
      # has no effect if already active.
      queue.activate
      true
    end
def push_to_thread_queue(context)
      thread_name = context.respond_to?(:thread_name) ? context.thread_name : ::RightScale::AgentConfig.default_thread_name
      queue = nil
      @mutex.synchronize do
        queue = @thread_name_to_queue[thread_name]
        unless queue
          # continuation for when thread-named queue is finally closed.
          queue = create_thread_queue(thread_name) { push(THREAD_QUEUE_CLOSED_BUNDLE) }
          @thread_name_to_queue[thread_name] = queue
        end
      end

      # push context to selected thread queue
      queue.push(context)

      # always (re)activate in case an individual thread queue died unexpectedly.
      # has no effect if already active.
      queue.activate
      true
    end
Pushes a context to a thread based on a name determined from the context.

 === Parameters
 context(Object):: any kind of context object

 === Return
 true:: always true