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

Make CondVar non-copyable, non-moveable #1426

Merged
merged 1 commit into from May 9, 2023
Merged

Make CondVar non-copyable, non-moveable #1426

merged 1 commit into from May 9, 2023

Conversation

hainest
Copy link
Contributor

@hainest hainest commented May 9, 2023

This makes it consistent with std::condition_variable.

Found using cppcheck:

common/src/dthread.h:114:4: warning: Class 'CondVar' does not have a copy constructor which is recommended since it has dynamic memory/resource allocation(s). [noCopyConstructor]
mutex = new mutex_t;
^
common/src/dthread.h:114:4: warning: Class 'CondVar' does not have a operator= which is recommended since it has dynamic memory/resource allocation(s). [noOperatorEq]
mutex = new mutex_t;

This makes it consistent with std::condition_variable.

Found using cppcheck:

common/src/dthread.h:114:4: warning: Class 'CondVar' does not have a copy constructor which is recommended since it has dynamic memory/resource allocation(s). [noCopyConstructor]
   mutex = new mutex_t;
   ^
common/src/dthread.h:114:4: warning: Class 'CondVar' does not have a operator= which is recommended since it has dynamic memory/resource allocation(s). [noOperatorEq]
   mutex = new mutex_t;
@hainest hainest added the code cleanup Bring the code up to modern standards or remove deprecated features label May 9, 2023
@hainest hainest requested a review from kupsch May 9, 2023 15:10
@hainest hainest self-assigned this May 9, 2023
@hainest hainest merged commit e5409c4 into master May 9, 2023
2 checks passed
@hainest hainest deleted the condvar_no_copy branch May 9, 2023 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code cleanup Bring the code up to modern standards or remove deprecated features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants