|
|
@ -9,13 +9,13 @@ namespace Emby.Server.Implementations.Data
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public sealed class ManagedConnection : IDisposable
|
|
|
|
public sealed class ManagedConnection : IDisposable
|
|
|
|
{
|
|
|
|
{
|
|
|
|
private readonly SemaphoreSlim? _writeLock;
|
|
|
|
private readonly SemaphoreSlim _writeLock;
|
|
|
|
|
|
|
|
|
|
|
|
private SQLiteDatabaseConnection? _db;
|
|
|
|
private SQLiteDatabaseConnection? _db;
|
|
|
|
|
|
|
|
|
|
|
|
private bool _disposed;
|
|
|
|
private bool _disposed = false;
|
|
|
|
|
|
|
|
|
|
|
|
public ManagedConnection(SQLiteDatabaseConnection db, SemaphoreSlim? writeLock)
|
|
|
|
public ManagedConnection(SQLiteDatabaseConnection db, SemaphoreSlim writeLock)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_db = db;
|
|
|
|
_db = db;
|
|
|
|
_writeLock = writeLock;
|
|
|
|
_writeLock = writeLock;
|
|
|
@ -73,7 +73,7 @@ namespace Emby.Server.Implementations.Data
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
_writeLock?.Release();
|
|
|
|
_writeLock.Release();
|
|
|
|
|
|
|
|
|
|
|
|
_db = null; // Don't dispose it
|
|
|
|
_db = null; // Don't dispose it
|
|
|
|
_disposed = true;
|
|
|
|
_disposed = true;
|
|
|
|