perf: avoid taking mutex on task deactivation (#7572)

This commit is contained in:
Sebastian Ullrich 2025-03-19 16:59:45 +01:00 committed by GitHub
parent d7d1754e69
commit a5348f4bdc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -926,6 +926,12 @@ public:
}
void deactivate_task(lean_task_object * t) {
if (object * v = t->m_value) {
lean_assert(t->m_imp == nullptr);
lean_dec(v);
free_task(t);
return;
}
unique_lock<mutex> lock(m_mutex);
if (object * v = t->m_value) {
lean_assert(t->m_imp == nullptr);