aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Data/ManagedConnection.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Emby.Server.Implementations/Data/ManagedConnection.cs')
-rw-r--r--Emby.Server.Implementations/Data/ManagedConnection.cs13
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;