Yield the BBQueue writer instead of spin looping

This commit is contained in:
Kerollmops 2024-12-04 14:16:40 +01:00
parent 54341c2e80
commit 261d2ceb06
No known key found for this signature in database
GPG Key ID: F250A4C4E3AE5F5F

View File

@ -661,6 +661,11 @@ where
if sender.is_disconnected() {
return Err(Error::InternalError(InternalError::AbortedIndexation));
}
// We prefer to yield and allow the writing thread
// to do its job, especially beneficial when there
// is only one CPU core available.
std::thread::yield_now();
}
}