mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-14 00:53:57 -07:00
added exceptron log target.
This commit is contained in:
parent
e37f413e19
commit
5ea794939c
26 changed files with 3113 additions and 0 deletions
36
Exceptron.Client/fastJSON/SafeDictionary.cs
Normal file
36
Exceptron.Client/fastJSON/SafeDictionary.cs
Normal file
|
@ -0,0 +1,36 @@
|
|||
//http://fastjson.codeplex.com/
|
||||
//http://fastjson.codeplex.com/license
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exceptron.Client.fastJSON
|
||||
{
|
||||
internal class SafeDictionary<TKey, TValue>
|
||||
{
|
||||
private readonly object _Padlock = new object();
|
||||
private readonly Dictionary<TKey, TValue> _Dictionary = new Dictionary<TKey, TValue>();
|
||||
|
||||
|
||||
internal bool TryGetValue(TKey key, out TValue value)
|
||||
{
|
||||
return _Dictionary.TryGetValue(key, out value);
|
||||
}
|
||||
|
||||
internal TValue this[TKey key]
|
||||
{
|
||||
get
|
||||
{
|
||||
return _Dictionary[key];
|
||||
}
|
||||
}
|
||||
|
||||
internal void Add(TKey key, TValue value)
|
||||
{
|
||||
lock (_Padlock)
|
||||
{
|
||||
if (_Dictionary.ContainsKey(key) == false)
|
||||
_Dictionary.Add(key, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue