Skip to content

Commit

Permalink
Merge pull request #96 from MelbourneHighSchoolRobotics/write_waits
Browse files Browse the repository at this point in the history
Ensure `wait_for_tick` also waits for writes to occur.
  • Loading branch information
peter-drew authored Sep 11, 2020
2 parents 5fd6bf5 + ca255df commit b70f5d0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions ev3sim/attach.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,10 @@ def sleep(seconds):

data['last_checked_tick'] = data['tick']
def wait_for_tick():
if data['last_checked_tick'] == data['tick']:
with data['condition_updated']:
with data['condition_updated']:
while data['actions_queue'].qsize():
data['condition_updated'].wait(0.1)
if data['last_checked_tick'] == data['tick']:
while True:
if data['last_checked_tick'] != data['tick']:
data['last_checked_tick'] = data['tick']
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

setup(
name="ev3sim",
version="1.2.2",
version="1.2.3",
description="Simulate ev3dev programs in Python",
long_description=README,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit b70f5d0

Please sign in to comment.