mirror of
				https://github.com/esphome/esphome.git
				synced 2025-11-04 09:01:49 +00:00 
			
		
		
		
	Relax memory order to acquire
This commit is contained in:
		@@ -348,7 +348,7 @@ TransferRequest *USBClient::get_trq_() {
 | 
				
			|||||||
    // Slot i appears available, try to claim it atomically
 | 
					    // Slot i appears available, try to claim it atomically
 | 
				
			||||||
    trq_bitmask_t desired = mask | lsb;
 | 
					    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
 | 
					      auto i = __builtin_ctz(lsb);  // count trailing zeroes
 | 
				
			||||||
      // Successfully claimed slot i - prepare the TransferRequest
 | 
					      // Successfully claimed slot i - prepare the TransferRequest
 | 
				
			||||||
      auto *trq = &this->requests_[i];
 | 
					      auto *trq = &this->requests_[i];
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user