Skip to content
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

Fix reading an uninitialized value of defaultMainDelayOptIn due to in… #3046

Merged
merged 2 commits into from
Dec 10, 2021

Conversation

qwwdfsad
Copy link
Collaborator

…itialization cycle and add a test that ensures this behaviour in the future

Fixes #3044

…itialization cycle and add a test that ensures this behaviour in the future

Fixes #3044
private val defaultMainDelayOptIn = systemProp("kotlinx.coroutines.main.delay", true)

internal actual val DefaultDelay: Delay = initializeDefaultDelay()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wow! TIL. This changes everything. I will not be able to forget this.

Now the test module correctly exposes that initially the Main
dispatcher is missing, so the default delay mechanism is not
rewritten.
@dkhalanskyjb dkhalanskyjb marked this pull request as ready for review December 10, 2021 07:20
@dkhalanskyjb dkhalanskyjb merged commit 19cefbf into develop Dec 10, 2021
@dkhalanskyjb dkhalanskyjb deleted the fix-main-delay branch December 10, 2021 08:23
woainikk pushed a commit that referenced this pull request Dec 14, 2021
Fix reading an uninitialized value of defaultMainDelayOptIn due to
the initialization cycle and add a test that ensures this behaviour in the future

Fixes #3044
yorickhenning pushed a commit to yorickhenning/kotlinx.coroutines that referenced this pull request Jan 28, 2022
Fix reading an uninitialized value of defaultMainDelayOptIn due to
the initialization cycle and add a test that ensures this behaviour in the future

Fixes Kotlin#3044
pablobaxter pushed a commit to pablobaxter/kotlinx.coroutines that referenced this pull request Sep 14, 2022
Fix reading an uninitialized value of defaultMainDelayOptIn due to
the initialization cycle and add a test that ensures this behaviour in the future

Fixes Kotlin#3044
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.

None yet

2 participants