Skip to content

Require nThreads to be a sane value#23

Open
cactorium wants to merge 3 commits into
OpenCVBlobsLib:masterfrom
cactorium:master
Open

Require nThreads to be a sane value#23
cactorium wants to merge 3 commits into
OpenCVBlobsLib:masterfrom
cactorium:master

Conversation

@cactorium

Copy link
Copy Markdown

This causes all kinds of interesting undefined behavior if nThreads is zero here

@luca-nardelli

Copy link
Copy Markdown
Contributor

Thanks for pointing that out! Actually, I think it would be better to throw an exception if nThreads <= 0, since this is definitely something that shouldn't happen, and forcing the value to 1 silently doesn't seem the best thing to do to me.

@cactorium

Copy link
Copy Markdown
Author

No problem! Does an assertion work better?

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