Method: Mongo::BackgroundThread#run!

Defined in:
lib/mongo/background_thread.rb

#run!Object

Start the background thread.

If the thread is already running, this method does nothing.



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/mongo/background_thread.rb', line 46

def run!
  if @stop_requested && @thread
    wait_for_stop
    if @thread.alive?
      log_warn("Starting a new background thread in #{self}, but the previous background thread is still running")
      @thread = nil
    end
    @stop_requested = false
  end
  if running?
    @thread
  else
    start!
  end
end