progschj / ThreadPool

A simple C++11 Thread Pool implementation
zlib License
7.63k stars 2.21k forks source link

fix: should use lock_guard #92

Open jesson1 opened 2 years ago

jesson1 commented 2 years ago

These two places do not serve as locks. You should use std:: lock_ guard

ywxktc commented 2 years ago

Same as #74 but its author closes itself.

Smalldy commented 2 years ago

is it necessary? what's different in this situation?

ywxktc commented 2 years ago

is it necessary? what's different in this situation?

I think they are same. lock_gurad and unique_lock are locked on construction.

monchin commented 1 year ago

is it necessary? what's different in this situation?

this answer is good. For condition_variable we should use unique_lock