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

Simplify locking code #7

Open
ennerf opened this issue Oct 9, 2018 · 0 comments
Open

Simplify locking code #7

ennerf opened this issue Oct 9, 2018 · 0 comments

Comments

@ennerf
Copy link
Contributor

ennerf commented Oct 9, 2018

There is quite a bit of error handling code required by the fact that users may ctrl+c when copying an image, which causes the user lock to never be released. This is tough to understand and prone to errors.

In other projects I've switched to using a wrapping handle class that implements RAII (lock in constructors, unlock in destructor), which can guarantee that the lock is always released once it's out of scope, i.e., when exiting the getsnapshot function (for any reason). HebiCam should switch over as well.

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

No branches or pull requests

1 participant