Add more lengthy comment explaining cyclic avoidance

Co-authored-by: Bartłomiej Dach <dach.bartlomiej@gmail.com>
This commit is contained in:
Dean Herbert 2022-01-23 23:15:39 +09:00 committed by GitHub
parent 5e7993c35a
commit 249f0f9697
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -292,7 +292,9 @@ namespace osu.Game.Database
{
Debug.Assert(ThreadSafety.IsUpdateThread);
// Get context outside of flag update to ensure beyond doubt this can't be cyclic.
// 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
// cyclic invocations of the subscription callback.
var realm = Context;
lock (contextLock)