Huoke opened a new issue, #2489:
URL: https://github.com/apache/brpc/issues/2489

   **Describe the bug (描述bug)**
   ```c++
   inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr, Atomic32 
increment)
   {
     Atomic32 temp = increment;
     __asm__ __volatile__("lock; xaddl %0,%1"
                          : "+r" (temp), "+m" (*ptr)
                          : : "memory");
     // temp now holds the old value of *ptr
     if (AtomicOps_Internalx86CPUFeatures.has_amd_lock_mb_bug) {
         __asm__ __volatile__("lfence" : : : "memory");
     }
     return temp + increment;
   }
   ```
   上面的代码中内联汇编原子交换和相加,temp保存的是旧的*ptr中的值,那么*ptr中保存的是不是相加后的值?
   内联汇编这里的输出操作数这里看不懂,求解惑
   **To Reproduce (复现方法)**
   null
   **Expected behavior (期望行为)**
   
   **Versions (各种版本)**
   OS:
   Compiler:
   brpc: 1.0.0-rc02
   protobuf:
   
   **Additional context/screenshots (更多上下文/截图)**
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org
For additional commands, e-mail: dev-h...@brpc.apache.org

Reply via email to