logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class UnityAssetUtilsAddressablesThreadingTests

    Guards the main-thread threading contract documented on UnityAssetUtils.

    Addressables mutates unsynchronized internal state (m_resultToHandle and the global operation-callback node cache) from the completion callbacks that WaitForCompletion pumps on the calling thread. Before the fix, Serenity's async helpers awaited with ConfigureAwait(false) and released handles from the resulting thread-pool continuation, so a blocking load overlapping an async one corrupted that state and Addressables logged (and swallowed) an IndexOutOfRangeException or NullReferenceException from inside its own callback dispatch.

    The test drives only production entry points — LoadAllFromAnyAsync<T>(IEnumerable<string>, CancellationToken) running concurrently with LoadAllFromAnyBlocking<T>(IEnumerable<string>) on the main thread — so it is the production code, not the test, that decides which thread each Addressables call lands on. Reintroducing ConfigureAwait(false) on any of those awaits fails this test within a few rounds.

    Inheritance
    object
    UnityAssetUtilsAddressablesThreadingTests
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.UnityGlobal.Tests.Infrastructure
    Assembly: Tests.dll
    Syntax
    public class UnityAssetUtilsAddressablesThreadingTests

    Constructors

    UnityAssetUtilsAddressablesThreadingTests()

    Declaration
    public UnityAssetUtilsAddressablesThreadingTests()

    Methods

    AsyncLoadOverlappingBlockingLoad_DoesNotCorruptAddressablesState()

    Declaration
    public IEnumerator AsyncLoadOverlappingBlockingLoad_DoesNotCorruptAddressablesState()
    Returns
    Type Description
    IEnumerator

    SetUp()

    Declaration
    public void SetUp()

    TearDown()

    Declaration
    public void TearDown()
    In this article
    © 2026 Serenity. All Rights Reserved