Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit eab5003

Browse filesBrowse files
committed
Fixed mutex name
1 parent 31a3653 commit eab5003
Copy full SHA for eab5003

File tree

Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed

‎src/Exceptionless/Logging/FileExceptionlessLog.cs

Copy file name to clipboardExpand all lines: src/Exceptionless/Logging/FileExceptionlessLog.cs
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,27 +312,27 @@ protected string GetLastLinesFromFile(int lines = 100) {
312312
/// Allows file based locking across processes
313313
/// </summary>
314314
private Mutex CreateSystemFileMutex(string fileNameOrPath) {
315+
string name = GetFileBasedMutexName(fileNameOrPath);
316+
315317
#if NET45
316318
var security = new MutexSecurity();
317319
var allowEveryoneRule = new MutexAccessRule(new SecurityIdentifier(WellKnownSidType.WorldSid, null), MutexRights.FullControl, AccessControlType.Allow);
318320
security.AddAccessRule(allowEveryoneRule);
319321

320-
string name = GetFileBasedMutexName(fileNameOrPath);
321-
322322
try {
323323
return new Mutex(false, name, out bool _, security);
324324
} catch (Exception ex) {
325325
if (ex is SecurityException || ex is UnauthorizedAccessException || ex is NotSupportedException || ex is NotImplementedException) {
326326
System.Diagnostics.Trace.WriteLine("Exceptionless: Error creating global mutex falling back to previous implementation: {0}", ex.ToString());
327-
return new Mutex(false, nameof(FileExceptionlessLog));
327+
return new Mutex(false, name);
328328
}
329329

330330
System.Diagnostics.Trace.WriteLine("Exceptionless: Error creating global mutex: {0}", ex.ToString());
331331
throw;
332332
}
333333
#else
334334
System.Diagnostics.Trace.WriteLine("Exceptionless: This platform does not support taking out a global mutex");
335-
return new Mutex(false, nameof(FileExceptionlessLog));
335+
return new Mutex(false, name);
336336
#endif
337337
}
338338

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.