mirror of
https://github.com/osukey/osukey.git
synced 2025-08-06 16:13:57 +09:00
Move context retrieval inside lock
This commit is contained in:
@ -309,13 +309,13 @@ namespace osu.Game.Database
|
|||||||
{
|
{
|
||||||
Debug.Assert(ThreadSafety.IsUpdateThread);
|
Debug.Assert(ThreadSafety.IsUpdateThread);
|
||||||
|
|
||||||
|
lock (contextLock)
|
||||||
|
{
|
||||||
// Retrieve context outside of flag update to ensure that the context is constructed,
|
// Retrieve context outside of flag update to ensure that the context is constructed,
|
||||||
// as attempting to access it inside the subscription if it's not constructed would lead to
|
// as attempting to access it inside the subscription if it's not constructed would lead to
|
||||||
// cyclic invocations of the subscription callback.
|
// cyclic invocations of the subscription callback.
|
||||||
var realm = Context;
|
var realm = Context;
|
||||||
|
|
||||||
lock (contextLock)
|
|
||||||
{
|
|
||||||
Debug.Assert(!customSubscriptionsResetMap.TryGetValue(action, out var found) || found == null);
|
Debug.Assert(!customSubscriptionsResetMap.TryGetValue(action, out var found) || found == null);
|
||||||
|
|
||||||
current_thread_subscriptions_allowed.Value = true;
|
current_thread_subscriptions_allowed.Value = true;
|
||||||
|
Reference in New Issue
Block a user