原创 linux簡單單個變量的無鎖計算

看圖即可: //其實就是一組原子操作的內核函數(具體意思網上查吧,很簡單的): type __sync_fetch_and_add (type *ptr, type value);type __sync_fetch_and_sub (