Repository: dotnet/efcore
File: src/EFCore/Infrastructure/Internal/LazyLoader.cs (C#)

Code before:
            return;
        }

        try
        {
            // ShouldLoad is called after _isLoading.Add because it could attempt to load the property. See #13138.
            if (ShouldLoad(entity, navigationName, out var entry))
            {
                try
                {
                    entry.Load(
                        _queryTrackingBehavior == QueryTrackingBehavior.NoTrackingWithIdentityResolution
                            ? LoadOptions.ForceIdentityResolution
                            : LoadOptions.None);
                }
                catch
                {
                    entry.IsLoaded = false;
                    throw;
                }
            }
        }
        finally
        {
            isLoadingValue.TrySetResult();
            lock (_isLoadingLock)
            {
                _isLoading.Remove(navEntry);
            }
        }
    }

    /// <summary>
    ///     This is an internal API that supports the Entity Framework Core infrastructure and not subject to
    ///     the same compatibility standards as public APIs. It may be changed or removed without notice in
    ///     any release. You should only use it directly in your code with extreme caution and knowing that
    ///     doing so can result in application failures when updating to a new Entity Framework Core release.
    /// </summary>
    public virtual async Task LoadAsync(
        object entity,
        CancellationToken cancellationToken = default,
        [CallerMemberName] string navigationName = "")
    {
        Check.NotNull(entity, nameof(entity));
        Check.NotEmpty(navigationName, nameof(navigationName));

        var navEntry = (entity, navigationName);

        bool exists;
        TaskCompletionSource isLoadingValue;


Review comment (suggestion):
```suggestion
            isLoadingValue.TrySetResult();
            s_isLoadingCallDepth.Value--;
```

Code after:
            _isLoadingCallDepth.Value--;
            return;
        }

        try
        {
            // ShouldLoad is called after _isLoading.Add because it could attempt to load the property. See #13138.
            if (ShouldLoad(entity, navigationName, out var entry))
            {
                try
                {
                    entry.Load(
                        _queryTrackingBehavior == QueryTrackingBehavior.NoTrackingWithIdentityResolution
                            ? LoadOptions.ForceIdentityResolution
                            : LoadOptions.None);
                }
                catch
                {
                    entry.IsLoaded = false;
                    throw;
                }
            }
        }
        finally
        {
            isLoadingValue.TrySetResult();
            _isLoadingCallDepth.Value--;
            lock (_isLoadingLock)
            {
                _isLoading.Remove(navEntry);
            }
        }
    }

    /// <summary>
    ///     This is an internal API that supports the Entity Framework Core infrastructure and not subject to
    ///     the same compatibility standards as public APIs. It may be changed or removed without notice in
    ///     any release. You should only use it directly in your code with extreme caution and knowing that
    ///     doing so can result in application failures when updating to a new Entity Framework Core release.
    /// </summary>
    public virtual async Task LoadAsync(
        object entity,
        CancellationToken cancellationToken = default,
        [CallerMemberName] string navigationName = "")
    {
        Check.NotNull(entity, nameof(entity));
        Check.NotEmpty(navigationName, nameof(navigationName));

        var navEntry = (entity, navigationName);

        bool exists;