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

RemoveCurrent method for thread context sharing #398

Merged
merged 10 commits into from
Sep 5, 2018

Conversation

christian-rauch
Copy link
Collaborator

This PR contains a subpart of commits from PR #389 which deals with context sharing. I am submitting this set of commits since it is already useful for X11+GLX and removes the requirement to rebase these commits on master for maintaining the x11_egl branch.
As discussed in #395, thread local storage only works for sequentially created threads. I.e. it does not work in the HelloPangolinThreads example, where a window is created in the main thread and rendering is done in a separate run thread.

The PR mainly adds a new method RemoveCurrent for WindowInterface/PangolinGl which is supposed to unbind the current context. As shown in the example, it needs to be called at the end of a thread, before switching to another thread. The current behaviour for sequential threading is not affected, i.e. sequential threads do not require to call RemoveCurrent.

This is tested and working as intended in the HelloPangolinThreads example with X11+GLX and X11+EGL.

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.

2 participants