Fixed locking around notification
Deduplication locking had test_and_set incorrect direction.
This commit is contained in:
committed by
Matthew Parkinson
parent
f398545154
commit
7768765fe8
@@ -146,18 +146,17 @@ namespace snmalloc
|
||||
|
||||
// Depulicate calls into here, and make single threaded.
|
||||
if (lock.test_and_set())
|
||||
{
|
||||
timers.apply_all([time_ms](PalTimerObject* curr) {
|
||||
if (
|
||||
(curr->last_run == 0) ||
|
||||
((time_ms - curr->last_run) > curr->repeat))
|
||||
{
|
||||
curr->last_run = time_ms;
|
||||
curr->pal_notify(curr);
|
||||
}
|
||||
});
|
||||
lock.clear();
|
||||
}
|
||||
return;
|
||||
|
||||
timers.apply_all([time_ms](PalTimerObject* curr) {
|
||||
if (
|
||||
(curr->last_run == 0) || ((time_ms - curr->last_run) > curr->repeat))
|
||||
{
|
||||
curr->last_run = time_ms;
|
||||
curr->pal_notify(curr);
|
||||
}
|
||||
});
|
||||
lock.clear();
|
||||
}
|
||||
};
|
||||
} // namespace snmalloc
|
||||
|
||||
Reference in New Issue
Block a user