mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 13:22:55 +08:00
Tidy up some missed inspections in RealmContextFactory
This commit is contained in:
parent
391259c713
commit
382a40b243
@ -59,7 +59,6 @@ namespace osu.Game.Database
|
|||||||
private static readonly GlobalStatistic<int> commits = GlobalStatistics.Get<int>("Realm", "Commits");
|
private static readonly GlobalStatistic<int> commits = GlobalStatistics.Get<int>("Realm", "Commits");
|
||||||
private static readonly GlobalStatistic<int> rollbacks = GlobalStatistics.Get<int>("Realm", "Rollbacks");
|
private static readonly GlobalStatistic<int> rollbacks = GlobalStatistics.Get<int>("Realm", "Rollbacks");
|
||||||
private static readonly GlobalStatistic<int> contexts = GlobalStatistics.Get<int>("Realm", "Contexts");
|
private static readonly GlobalStatistic<int> contexts = GlobalStatistics.Get<int>("Realm", "Contexts");
|
||||||
private Thread writingThread;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get a context for the current thread for read-only usage.
|
/// Get a context for the current thread for read-only usage.
|
||||||
@ -86,11 +85,7 @@ namespace osu.Game.Database
|
|||||||
{
|
{
|
||||||
context = getContextForCurrentThread();
|
context = getContextForCurrentThread();
|
||||||
|
|
||||||
if (currentWriteTransaction == null)
|
currentWriteTransaction ??= context.BeginWrite();
|
||||||
{
|
|
||||||
writingThread = Thread.CurrentThread;
|
|
||||||
currentWriteTransaction = context.BeginWrite();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
@ -144,7 +139,6 @@ namespace osu.Game.Database
|
|||||||
}
|
}
|
||||||
|
|
||||||
currentWriteTransaction = null;
|
currentWriteTransaction = null;
|
||||||
writingThread = null;
|
|
||||||
rollbackRequired = false;
|
rollbackRequired = false;
|
||||||
|
|
||||||
refreshCompleted = new ThreadLocal<bool>();
|
refreshCompleted = new ThreadLocal<bool>();
|
||||||
|
Loading…
Reference in New Issue
Block a user