chrisxx commited on
Commit
6bf5433
·
1 Parent(s): c0e2ec7

Fix: Use _stop instead of _stop_event to match reference

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -241,18 +241,18 @@ class FrameScheduler(threading.Thread):
241
  self.n_steps = int(n_steps)
242
  self.cfg = float(cfg)
243
  self.clamp = bool(clamp)
244
- self._stop_event = threading.Event()
245
  # FPS tracking
246
  self.frame_times = []
247
  self.last_frame_time = None
248
 
249
  def stop(self):
250
- self._stop_event.set()
251
 
252
  def run(self):
253
  global frame_index, latest_action
254
  next_tick = time.perf_counter()
255
- while not self._stop_event.is_set():
256
  start = time.perf_counter()
257
  if start - next_tick > self.frame_period * 0.75:
258
  next_tick = start + self.frame_period
 
241
  self.n_steps = int(n_steps)
242
  self.cfg = float(cfg)
243
  self.clamp = bool(clamp)
244
+ self._stop = threading.Event()
245
  # FPS tracking
246
  self.frame_times = []
247
  self.last_frame_time = None
248
 
249
  def stop(self):
250
+ self._stop.set()
251
 
252
  def run(self):
253
  global frame_index, latest_action
254
  next_tick = time.perf_counter()
255
+ while not self._stop.is_set():
256
  start = time.perf_counter()
257
  if start - next_tick > self.frame_period * 0.75:
258
  next_tick = start + self.frame_period