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 CGL multithreading error #71

Merged
merged 1 commit into from Oct 5, 2016

Conversation

@MortimerGoro
Copy link
Collaborator

MortimerGoro commented Oct 5, 2016

Multithreading tests fail with Err("CGLChoosePixelFormat") error on a MacBook with a clean macOS sierra install.

It seems that CGLChoosePixelFormat can fail if multiple threads try to open a display connection simultaneously. Fixed the issue adding a static mutex guard.

@emilio
Copy link
Member

emilio commented Oct 5, 2016

Well, this is probably ok. Please use a StaticMutex.

@MortimerGoro
Copy link
Collaborator Author

MortimerGoro commented Oct 5, 2016

Please use a StaticMutex.

It seems to have been removed from the std API, or do I need to use a nightly rust compiler? I'm testing with the latest stable 1.12.0

@emilio
Copy link
Member

emilio commented Oct 5, 2016

Hm... You're right, sorry. Can you use .lock().unwrap() instead of just .lock(), handle the error, or mention that you're explicitly ignoring it?

@MortimerGoro MortimerGoro force-pushed the MortimerGoro:cgl_choosepixelformat_error branch from db6108a to 76e6976 Oct 5, 2016
@MortimerGoro
Copy link
Collaborator Author

MortimerGoro commented Oct 5, 2016

Done!

@emilio emilio merged commit 0bd84c9 into servo:master Oct 5, 2016
1 check was pending
1 check was pending
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
@emilio
Copy link
Member

emilio commented Oct 5, 2016

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.