Increase threadsafety annotation coverage

This commit is contained in:
Anthony Towns
2022-04-20 16:47:29 +10:00
parent 9db941d773
commit 7d73f58e9c
12 changed files with 101 additions and 86 deletions

View File

@@ -87,7 +87,7 @@ public:
{
}
/** Enqueue a work item */
bool Enqueue(WorkItem* item)
bool Enqueue(WorkItem* item) EXCLUSIVE_LOCKS_REQUIRED(!cs)
{
LOCK(cs);
if (!running || queue.size() >= maxDepth) {
@@ -98,7 +98,7 @@ public:
return true;
}
/** Thread function */
void Run()
void Run() EXCLUSIVE_LOCKS_REQUIRED(!cs)
{
while (true) {
std::unique_ptr<WorkItem> i;
@@ -115,7 +115,7 @@ public:
}
}
/** Interrupt and exit loops */
void Interrupt()
void Interrupt() EXCLUSIVE_LOCKS_REQUIRED(!cs)
{
LOCK(cs);
running = false;