1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-31 15:12:06 +00:00

Relax memory order to acquire

This commit is contained in:
clydebarrow
2025-10-30 06:04:33 +10:00
parent d6c23ac056
commit a21057a744

View File

@@ -348,7 +348,7 @@ TransferRequest *USBClient::get_trq_() {
// Slot i appears available, try to claim it atomically
trq_bitmask_t desired = mask | lsb;
if (this->trq_in_use_.compare_exchange_weak(mask, desired)) {
if (this->trq_in_use_.compare_exchange_weak(mask, desired, std::memory_order::acquire)) {
auto i = __builtin_ctz(lsb); // count trailing zeroes
// Successfully claimed slot i - prepare the TransferRequest
auto *trq = &this->requests_[i];