aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd
diff options
context:
space:
mode:
authorcopilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>2025-12-07 00:19:04 +0000
committercopilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>2025-12-07 00:19:04 +0000
commit4e02b95eeac1cdd3d49f0ca0177f9d59a76e9ce4 (patch)
treed315abd8ce2021a0dfa7668b8ac2e5b01b403230 /src/slskd
parent1f98acd90622a66f0ec4a88f5c0c60c8a1cdd332 (diff)
downloadslskd-4e02b95eeac1cdd3d49f0ca0177f9d59a76e9ce4.tar.gz
Add handling for AbandonedMutexException from WaitOne call
Co-authored-by: jpdillingham <17145758+jpdillingham@users.noreply.github.com>
Diffstat (limited to 'src/slskd')
-rw-r--r--src/slskd/Program.cs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/slskd/Program.cs b/src/slskd/Program.cs
index 098cc324..bafac8b1 100644
--- a/src/slskd/Program.cs
+++ b/src/slskd/Program.cs
@@ -357,6 +357,13 @@ namespace slskd
Log.Warning("This can happen when running with insufficient permissions");
Log.Warning("The application will continue, but multiple instances may be able to run simultaneously");
}
+ catch (AbandonedMutexException ex)
+ {
+ Log.Warning($"Acquired an abandoned mutex: {ex.Message}");
+ Log.Warning("A previous instance may have terminated unexpectedly");
+
+ // The mutex is now owned by this thread, so we can continue
+ }
// derive the application directory value and defaults that are dependent upon it
AppDirectory ??= DefaultAppDirectory;