mirror of https://github.com/ppy/osu
Tidy up some missed inspections in RealmContextFactory
This commit is contained in:
parent
391259c713
commit
382a40b243
|
@ -59,7 +59,6 @@ private void onMigration(Migration migration, ulong oldschemaversion)
|
|||
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> contexts = GlobalStatistics.Get<int>("Realm", "Contexts");
|
||||
private Thread writingThread;
|
||||
|
||||
/// <summary>
|
||||
/// Get a context for the current thread for read-only usage.
|
||||
|
@ -86,11 +85,7 @@ public RealmWriteUsage GetForWrite()
|
|||
{
|
||||
context = getContextForCurrentThread();
|
||||
|
||||
if (currentWriteTransaction == null)
|
||||
{
|
||||
writingThread = Thread.CurrentThread;
|
||||
currentWriteTransaction = context.BeginWrite();
|
||||
}
|
||||
currentWriteTransaction ??= context.BeginWrite();
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
@ -144,7 +139,6 @@ private void usageCompleted(RealmWriteUsage usage)
|
|||
}
|
||||
|
||||
currentWriteTransaction = null;
|
||||
writingThread = null;
|
||||
rollbackRequired = false;
|
||||
|
||||
refreshCompleted = new ThreadLocal<bool>();
|
||||
|
|
Loading…
Reference in New Issue