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

OS synchronization context #1169

Merged
merged 3 commits into from
May 1, 2019
Merged

Conversation

TautvydasZilys
Copy link

This PR implements a mechanism for the runtime to provide a fallback SynchronizationContext. This is needed in scenarios where managed code doesn't necessarily set its own SynchronizationContext and awaits on OS UI thread. .NET runtime makes sure that we end up on the same thread after await, but there was no such mechanism in IL2CPP. Since the way it's handled is highly platform specific, I decided to implement those details in il2cpp OS abstraction layer.

This is one part of the fix for https://fogbugz.unity3d.com/f/cases/1130193/ (another part is in IL2CPP).

Is there anything I can do to minimize the risk of these changes? I made sure Mono builds on katana:

https://katana.bf.unity3d.com/projects/Mono%20Runtime%20and%20Classlibs/builders?krait-signal-handler_branch=master&mono-build-deps_branch=default&mono_branch=os-synchronization-context&boo_branch=unity-trunk&cecil_branch=unity-master&unityscript_branch=unity-trunk&mono-build-tools-extra_branch=master

However, I don't think any tests run there.

@joncham
Copy link
Member

joncham commented Apr 24, 2019

We build Mono on gitlab CI now. I kicked off build here: https://gitlab.cds.internal.unity3d.com/vm/mono/pipelines/48456

Tests will run as part of this.

@TautvydasZilys
Copy link
Author

Looks like that build completed successfully. Which step runs tests?

@joncham
Copy link
Member

joncham commented Apr 24, 2019

The Linux and OSX builds run tests. You'll see a nice All checks have passed message in your GitHub PR now.

Copy link
Member

@joncham joncham left a comment

Choose a reason for hiding this comment

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

Adding @joshpeterson to take a second look. Things look okay to me. Will need to sync with IL2CPP to get icalls to match up.

@TautvydasZilys
Copy link
Author

I have an IL2CPP branch ready to be PRed in once katana tests complete.

@TautvydasZilys TautvydasZilys merged commit 59ce130 into unity-master May 1, 2019
@TautvydasZilys TautvydasZilys deleted the os-synchronization-context branch July 23, 2019 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants