class PhusionPassenger::RequestHandler

def start_main_loop_thread

Start the main loop in a new thread. This thread will be stopped by #cleanup.
def start_main_loop_thread
  current_generation = @main_loop_generation
  @main_loop_thread = create_thread_and_abort_on_exception do
    main_loop
  end
  @main_loop_thread_lock.synchronize do
    while @main_loop_generation == current_generation
      @main_loop_thread_cond.wait(@main_loop_thread_lock)
    end
  end
end