Run prelock and postlock synchronously to avoid race condition#320
Merged
SebTM merged 1 commit intobetterlockscreen:nextfrom Feb 23, 2022
Merged
Run prelock and postlock synchronously to avoid race condition#320SebTM merged 1 commit intobetterlockscreen:nextfrom
SebTM merged 1 commit intobetterlockscreen:nextfrom
Conversation
As reported in issue betterlockscreen#285, running postlock in a subshell and immediately returning from lockselect() has a high chance of hitting `exit 0` before xset and dunstctl get a chance to execute. Run both prelock and postlock synchronously within lockselect().
1 task
Collaborator
|
Tested it and even I can't reproduce the issue on my machines I understand it can/will possibly happen for some user and can be fixed like this without breaking something else for me (and so other users so far) - so let's take it into the next beta :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
As reported in issue #285, running postlock in a subshell and immediately returning from lockselect() has a high chance of hitting
exit 0before xset and dunstctl get a chance to execute.Run both prelock and postlock synchronously within lockselect().
Fixes #285
How Has This Been Tested?
Running with
set -xshows both xset and dunstctl executing reliably as expected, andxset qshows the original DPMS standby time after a succesful unlock.Checklist:
There are 2 existing errors unrelated to my changes: