mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-13 12:33:42 +02:00
Increase threadsafety annotation coverage
This commit is contained in:
parent
9db941d773
commit
7d73f58e9c
12 changed files with 101 additions and 86 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue