Skip to content

fixes stop condition on sync emulator#1

Merged
petergjoel merged 2 commits intoDEIS-Tools:mainfrom
anton-christensen:main
Sep 15, 2021
Merged

fixes stop condition on sync emulator#1
petergjoel merged 2 commits intoDEIS-Tools:mainfrom
anton-christensen:main

Conversation

@anton-christensen
Copy link
Copy Markdown
Collaborator

No description provided.

if self._terminated >= len(self._devices):
if all([self._done[x] or not self._threads[x].is_alive()
for x in self.ids()]):
if self._round_lock.locked():
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anton-christensen is there some indentation that has gone wrong here?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small stylistic choice, but its a short line so i've moved it onto the same line.

def terminated(self, index:int):
self._progress.acquire()
self._done[index] = True
self._terminated += 1
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this _terminated variable should die now, the _done array implements the same functionality (but in a more robust way)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, it's removed in the new commit

@petergjoel petergjoel merged commit 4fc8b0c into DEIS-Tools:main Sep 15, 2021
michelealbano pushed a commit that referenced this pull request Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants