Skip to content

Use AsyncTask thread-safe debug logging in LinkNativeRuntime#12111

Merged
jonathanpeppers merged 2 commits into
mainfrom
copilot/fix-finder-use-thread-safe-log-debug-message
Jul 15, 2026
Merged

Use AsyncTask thread-safe debug logging in LinkNativeRuntime#12111
jonathanpeppers merged 2 commits into
mainfrom
copilot/fix-finder-use-thread-safe-log-debug-message

Conversation

Copilot AI commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

LinkNativeRuntime executes LinkRuntime via AsyncTask.WhenAll(...), so using the obsolete Log property from that background path is unsafe. This change switches the debug log call to the AsyncTask thread-safe helper without altering behavior or message content.

  • Change scope

    • Updated a single call site in src/Xamarin.Android.Build.Tasks/Tasks/LinkNativeRuntime.cs:
      • Log.LogDebugMessage(...)LogDebugMessage(...)
    • No other logging calls or task flow were changed.
  • Why this matters

    • Aligns AsyncTask usage with repository guidance for background-thread-safe logging.
    • Avoids direct use of obsolete Log property in async task execution.
  • Code change

    void LinkRuntime (ITaskItem abiItem)
    {
    	string abi = abiItem.ItemSpec;
    	LogDebugMessage ($"LinkRuntime ({abi})");
    }

Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix use of thread-safe LogDebugMessage in LinkNativeRuntime Use AsyncTask thread-safe debug logging in LinkNativeRuntime Jul 15, 2026
Copilot AI requested a review from jonathanpeppers July 15, 2026 02:54
@jonathanpeppers jonathanpeppers marked this pull request as ready for review July 15, 2026 13:28
Copilot AI review requested due to automatic review settings July 15, 2026 13:28
@jonathanpeppers jonathanpeppers merged commit 4b8f5a7 into main Jul 15, 2026
44 of 45 checks passed
@jonathanpeppers jonathanpeppers deleted the copilot/fix-finder-use-thread-safe-log-debug-message branch July 15, 2026 13:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates LinkNativeRuntime to use AsyncTask’s thread-safe debug logging helper when running LinkRuntime work concurrently, avoiding direct use of the TaskLoggingHelper debug log API from a background task context.

Changes:

  • Switched Log.LogDebugMessage (...) to LogDebugMessage (...) in LinkNativeRuntime.LinkRuntime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[fix-finder] Use thread-safe LogDebugMessage instead of Log.LogDebugMessage in LinkNativeRuntime

4 participants