Skip to content
This repository has been archived by the owner on Nov 5, 2022. It is now read-only.

Add AssertUIGoroutine to the Driver interface. #133

Merged
merged 1 commit into from
Jul 15, 2015

Conversation

ben-clayton
Copy link
Contributor

This is can be used to assert that a function is being called on the UI
go-routine, which is expected for all of the controls.

AssertUIGoroutine is called from the two most commonly called internal
functions of controls: Redraw and Relayout.

Should catch race conditions in applications using GXUI.

This is can be used to assert that a function is being called on the UI
go-routine, which is expected for all of the controls.

AssertUIGoroutine is called from the two most commonly called internal
functions of controls: Redraw and Relayout.

Should catch race conditions in appplications using GXUI.
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project, in which case you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

@ben-clayton
Copy link
Contributor Author

Pretty horrible - but has caught issues in some projects that uses GXUI.
Opening as a pull request to hear thoughts from anyone who might have opinions on this.

@sunwangme
Copy link

very good

@warpfork
Copy link

Sounds reasonable to me. Defense in depth and rapid detection 👍

ben-clayton added a commit that referenced this pull request Jul 15, 2015
Add AssertUIGoroutine to the Driver interface.
@ben-clayton ben-clayton merged commit 71ecb35 into master Jul 15, 2015
@ben-clayton ben-clayton deleted the assert_ui_goroutine branch July 15, 2015 09:17
@dmitshur
Copy link
Member

@ben-clayton, I don't think runtime.Callers is completely implemented in GopherJS yet, so this will currently fail there:

image

Is it okay if I made a PR here to disable this debug feature under js build tag, until it is supported?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants