Search Issue Tracker

By Design

Votes

1

Found in

2021.3.45f1

2022.3.50f1

6000.0.23f1

6000.1.0a1

Issue ID

UUM-84920

Regression

No

CancellationTokenSource(<timeout>) has incorrect cancellation status when used in WebGL Player

--

-

Reproduction steps:
1. Open the attached “repro-cts-unity-webgl.zip” project
2. Build and Run for WebGL (File > Build and Run)
3. In the Player press the “Start” button
4. Observe the text next to the button

Expected result: “Is Cancelled: True” text is visible
Actual result: “Is Cancelled: False” text is visible

Reproducible with: 2021.3.45f1, 2022.3.50f1, 6000.0.23f1, 6000.1.0a1

Reproducible on: Windows 11, macOS 15.0.1 (M1 Pro)
Not reproducible on: no other environment tested

Note:
- Does not reproduce in the Editor or Windows build

  1. Resolution Note:

    Thank you for reporting a bug to Unity.

    Managed (C#) threads aren’t supported due to the lack of a multithreaded garbage collection feature in WebAssembly.
    Due to this limitation, anything in the C# System.Threading namespace isn’t supported. For example, any timeouts specified in System.Threading.CancellationTokenSource don’t actually time out, because the cancellation mechanism is based on System.Threading.Timer.

    For more information please refer to "Lack of managed threading support" section of our documentation https://docs.unity3d.com/6000.1/Documentation/Manual/webgl-technical-overview.html.

    Today we will be closing this case. Thank you again for taking the time to report this issue.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.