Linux 上的互锁等效项 [英] Interlocked equivalent on Linux
本文介绍了Linux 上的互锁等效项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在 C++ Linux 应用程序中,获得 Interlocked 功能在 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?
推荐答案
经过进一步审查,这个 看起来很有希望.是的堆栈溢出.
Upon further review, this looks promising. Yay stack overflow.
这篇关于Linux 上的互锁等效项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文