This PR closes #27, the fact that base::SimpleThread could only accept parameters by std::ref() or rvalue reference. I fix this by greatly simplifying how we take in functions and parameters, and store all of this in a std::function<void()> and invoke it during SimpleThreadDelegate::Run(). At the same time we get to remove the entire base::helper namespace, and rename base/helper.h to base/callback.h.
This PR also fixes a race condition in TaskLoopForWorker::Quit(), by grabbing a lock before setting quit_ = true. This was causing the RunQuitRunQuit test to occasionally timeout.
This PR closes #27, the fact that base::SimpleThread could only accept parameters by std::ref() or rvalue reference. I fix this by greatly simplifying how we take in functions and parameters, and store all of this in a
std::function<void()>
and invoke it during SimpleThreadDelegate::Run(). At the same time we get to remove the entirebase::helper
namespace, and renamebase/helper.h
tobase/callback.h
.This PR also fixes a race condition in TaskLoopForWorker::Quit(), by grabbing a lock before setting
quit_ = true
. This was causing theRunQuitRunQuit
test to occasionally timeout.Inspiration: https://stackoverflow.com/questions/66501654/