-
Notifications
You must be signed in to change notification settings - Fork 31
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
Add a lockable context for improved memory safety. #296
Add a lockable context for improved memory safety. #296
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor stuff to fix (4 spaces indentation, 'morphologica' style) plus I don't know why you call set_context()? Does that compile? Visual::set_context takes a Visual* argument and is intended only for inclusion in callbacks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good now. I'll merge this once the CI passes
I'm getting "Merge attempt failed" "Merge already in progress" which I think is some sort of Github UI bug. Otherwise, this would already have been merged. |
there are now functions for contexts that mirror the mutex functionality that they represent. these are:
lockContext
tryLockContext
unlockContext
The underlying implementation just uses a
mutex
to allow a thread to lock the context to its thread while performing GL commands.