Skip to content

Commit

Permalink
Delay loop must be interruptible by stop trigger
Browse files Browse the repository at this point in the history
Avoid a possible deadlock.
  • Loading branch information
laanwj committed Jan 11, 2023
1 parent 4341be5 commit cd471e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sundog.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ static void psys_trace(struct psys_state *s, void *gs_)
} else { /* wait for mouse release */
unsigned buttons = 1;
int x, y;
while (buttons) {
while (buttons && !SDL_AtomicGet(&gs->stop_trigger)) {
gs->screen->vq_mouse(gs->screen, &buttons, &x, &y);
usleep(10000);
}
Expand Down

0 comments on commit cd471e0

Please sign in to comment.