Skip to content

Commit 1cfd876

Browse files
authored
With Windows event the first two periodic frames are sent back without delay (#1590)
When the ThreadBasedCyclicSendTask thread starts, the timer event was already set before entering the first loop. This resulted in the first timer wait to not wait.
1 parent efb301a commit 1cfd876

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

can/broadcastmanager.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,10 @@ def _run(self) -> None:
293293
msg_index = 0
294294
msg_due_time_ns = time.perf_counter_ns()
295295

296+
if USE_WINDOWS_EVENTS:
297+
# Make sure the timer is non-signaled before entering the loop
298+
win32event.WaitForSingleObject(self.event.handle, 0)
299+
296300
while not self.stopped:
297301
# Prevent calling bus.send from multiple threads
298302
with self.send_lock:

0 commit comments

Comments
 (0)