diff options
| author | Bond-009 <bond.009@outlook.com> | 2019-03-11 22:33:27 +0100 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2019-06-28 12:13:34 +0200 |
| commit | 27c29bbb4c75d5fc5c9111c5552c37a1f137dd58 (patch) | |
| tree | 02a330700c18119608a4ed4384f341f6a59fca6a /Emby.Server.Implementations/Data/ManagedConnection.cs | |
| parent | 30842656a7fb1d23eef245dcfb57287ebdb960a0 (diff) | |
Back to a single connection
Diffstat (limited to 'Emby.Server.Implementations/Data/ManagedConnection.cs')
| -rw-r--r-- | Emby.Server.Implementations/Data/ManagedConnection.cs | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/Emby.Server.Implementations/Data/ManagedConnection.cs b/Emby.Server.Implementations/Data/ManagedConnection.cs index 71b934a9b..4c3424410 100644 --- a/Emby.Server.Implementations/Data/ManagedConnection.cs +++ b/Emby.Server.Implementations/Data/ManagedConnection.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Concurrent; using System.Collections.Generic; using System.Threading; using SQLitePCL.pretty; @@ -9,8 +8,7 @@ namespace Emby.Server.Implementations.Data public class ManagedConnection : IDisposable { private SQLiteDatabaseConnection _db; - private SemaphoreSlim _writeLock; - private BlockingCollection<SQLiteDatabaseConnection> _readConPool; + private readonly SemaphoreSlim _writeLock; private bool _disposed = false; public ManagedConnection(SQLiteDatabaseConnection db, SemaphoreSlim writeLock) @@ -19,12 +17,6 @@ namespace Emby.Server.Implementations.Data _writeLock = writeLock; } - public ManagedConnection(SQLiteDatabaseConnection db, BlockingCollection<SQLiteDatabaseConnection> queue) - { - _db = db; - _readConPool = queue; - } - public IStatement PrepareStatement(string sql) { return _db.PrepareStatement(sql); @@ -77,8 +69,7 @@ namespace Emby.Server.Implementations.Data return; } - _writeLock?.Release(); - _readConPool?.Add(_db); + _writeLock.Release(); _db = null; // Don't dispose it _disposed = true; |
