Skip to content

Multiplatform BroadcastFrameClockTest with sleep #2104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: jb-main
Choose a base branch
from

Conversation

igordmn
Copy link
Collaborator

@igordmn igordmn commented May 12, 2025

Additional changes from #2098 needed for 1.8.0-alpha02


package androidx.compose.runtime.internal

internal expect fun isSleepAvailable(): Boolean
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The nonEmulatorCommonTest changes should be upstreamed

@igordmn igordmn changed the title Igor.demin/deadlock cherry pick jb main Multiplatform BroadcastFrameClockTest with sleep May 12, 2025
In the referenced bug, there's a deadlock where
a call to `withFrameNanos` is being canceled on one thread while another
thread is dispatching another thread. To avoid the deadlock, this
commit updates the BroadcastFrameClock awaiter so that it's possible
to cancel an awaiter without acquiring any locks.

Fixes: b/407027032
Test: BroadcastFrameClockTest.locklessCancellation
Relnote: "Fixed a deadlock that may affect Molecule users when a
suspended call to `FrameClock.withFrameNanos` is cancelled while a
frame is being dispatched."

Change-Id: I89cab8e3eab14ed9a85b36e151f11b5f526a01fd
@igordmn igordmn force-pushed the igor.demin/deadlock-cherry-pick-jb-main branch from 60d9150 to 8a70124 Compare May 14, 2025 12:43
@igordmn igordmn force-pushed the igor.demin/deadlock-cherry-pick-jb-main branch from 8a70124 to 01b43ad Compare May 14, 2025 12:46
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.

3 participants