Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task: Remove unnecessary calls to defer g.mu.Unlock() #12710

Merged
merged 8 commits into from
Jan 18, 2024

Conversation

tomponline
Copy link
Member

@tomponline tomponline commented Jan 8, 2024

Hopefully fixes #12540 by simplifying the calls to unlocking the mutex.

Even if it doesn't fix it, it should make it easier to reason about, rather than using defer unnecessarily.

Closes #12540

@tomponline tomponline self-assigned this Jan 8, 2024
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
MusicDin
MusicDin previously approved these changes Jan 8, 2024
lxd/task/group.go Outdated Show resolved Hide resolved
That initialises the internal running map.

Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
To ensure its correctly initialised.

Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
Task Group should always be initialised using NewGroup and so running will always be non-nil.

Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
@tomponline tomponline merged commit 029b142 into canonical:main Jan 18, 2024
26 checks passed
@tomponline tomponline deleted the tp-task-mu branch January 18, 2024 08:26
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.

Panic during test run
2 participants