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

Add a lockable context for improved memory safety. #296

Merged

Conversation

connagh-opteran
Copy link
Contributor

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.

Copy link
Collaborator

@sebjameswml sebjameswml left a 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.

morph/Visual.h Outdated Show resolved Hide resolved
morph/Visual.h Outdated Show resolved Hide resolved
morph/Visual.h Outdated Show resolved Hide resolved
morph/Visual.h Outdated Show resolved Hide resolved
morph/Visual.h Outdated Show resolved Hide resolved
Copy link
Collaborator

@sebjameswml sebjameswml left a 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

@sebjameswml
Copy link
Collaborator

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.

@sebjameswml sebjameswml merged commit b974a19 into ABRG-Models:main Dec 2, 2024
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