From 77bca5463f2b54c079c07eaac3cf5d321ad94203 Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Sat, 5 Feb 2022 08:44:43 +0200 Subject: [PATCH] store: don't lock for_each_term It's only called from the parser with a store, and when we _already_ hold the lock. --- lib/mu-store.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/mu-store.cc b/lib/mu-store.cc index 75542db4..01702310 100644 --- a/lib/mu-store.cc +++ b/lib/mu-store.cc @@ -610,8 +610,10 @@ Store::for_each_term(const std::string& field, Store::ForEachTermFunc func) cons size_t n{}; xapian_try([&] { - std::lock_guard guard{priv_->lock_}; - const auto id = field_id(field.c_str()); + /* + * Do _not_ take a lock; this is only called from + * the message parser which already has the lock */ + const auto id = field_id(field.c_str()); if (id == MU_MSG_FIELD_ID_NONE) return;