diff options
author | Kenneth Hsu <kennethhsu@gmail.com> | 2018-03-18 05:59:23 +0300 |
---|---|---|
committer | Kenneth Hsu <kennethhsu@gmail.com> | 2018-03-18 05:59:23 +0300 |
commit | c00c6fd19b1170b9df9d47ba762517d8ef6bde15 (patch) | |
tree | 0302849928e8345fcf0d3fc38510e32e01a98ab5 /Duplicati/Library/Logging | |
parent | 883922e2f3437ddffc9321dca097a9515ece0171 (diff) |
Make fields containing lock objects readonly.
If one of these fields is accidentally reassigned, it's possible for
threads to be oblivious to an existing lock. By making the fields
readonly, we will be notified at compile-time if we inadvertently
redefine one of these fields.
Diffstat (limited to 'Duplicati/Library/Logging')
-rw-r--r-- | Duplicati/Library/Logging/Log.cs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Duplicati/Library/Logging/Log.cs b/Duplicati/Library/Logging/Log.cs index 0ec235b98..7346a95f4 100644 --- a/Duplicati/Library/Logging/Log.cs +++ b/Duplicati/Library/Logging/Log.cs @@ -85,7 +85,7 @@ namespace Duplicati.Library.Logging /// <summary>
/// Static lock object to provide thread safe logging
/// </summary>
- private static object m_lock = new object();
+ private static readonly object m_lock = new object();
/// <summary>
/// Gets the lock instance used to protect the logging calls
|