Method: OpenC3::InterfaceThread#stop

Defined in:
lib/openc3/tools/cmd_tlm_server/interface_thread.rb

#stopObject

Disconnect from the interface and stop the thread



133
134
135
136
137
138
139
140
141
142
# File 'lib/openc3/tools/cmd_tlm_server/interface_thread.rb', line 133

def stop
  @mutex.synchronize do
    # Need to make sure that @cancel_thread is set and the interface disconnected within
    # mutex to ensure that connect() is not called when we want to stop()
    @cancel_thread = true
    @thread_sleeper.cancel
    @interface.disconnect
  end
  OpenC3.kill_thread(self, @thread) if @thread and @thread != Thread.current
end