refactor: Add TSA annotations to the WorkQueue class members

This commit is contained in:
Hennadii Stepanov 2021-05-09 13:48:07 +03:00
parent 5925f1e652
commit 34b04eec44
No known key found for this signature in database
GPG key ID: 410108112E7EA81F

View file

@ -63,12 +63,11 @@ template <typename WorkItem>
class WorkQueue
{
private:
/** Mutex protects entire object */
Mutex cs;
std::condition_variable cond;
std::deque<std::unique_ptr<WorkItem>> queue;
bool running;
size_t maxDepth;
std::condition_variable cond GUARDED_BY(cs);
std::deque<std::unique_ptr<WorkItem>> queue GUARDED_BY(cs);
bool running GUARDED_BY(cs);
const size_t maxDepth;
public:
explicit WorkQueue(size_t _maxDepth) : running(true),