在Linux上的互锁等效 [英] Interlocked equivalent on Linux
本文介绍了在Linux上的互锁等效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在C ++ Linux应用程式中,最简单的方法是取得联锁功能在Win32提供?具体来说,一种轻量级的方法来原子地递增或添加32或64位整数?
In a C++ Linux app, what is the simplest way to get the functionality that the Interlocked functions on Win32 provide? Specifically, a lightweight way to atomically increment or add 32 or 64 bit integers?
推荐答案
进一步审查后,这个看起来很有前途。 Yay堆栈溢出。
Upon further review, this looks promising. Yay stack overflow.
这篇关于在Linux上的互锁等效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文