【发布时间】:2013-09-15 06:35:49
【问题描述】:
atomicity.h 是 c++ stl 的一部分。在其源文件中,它声明了两个关于原子操作的函数。这是整个源代码。我在哪里可以找到这些函数的定义。我在stl源代码中没有找到。
#ifndef _GLIBCXX_ATOMICITY_H
#define _GLIBCXX_ATOMICITY_H 1
#include <bits/atomic_word.h>
namespace __gnu_cxx
{
_Atomic_word
__attribute__ ((__unused__))
__exchange_and_add(volatile _Atomic_word* __mem, int __val);
void
__attribute__ ((__unused__))
__atomic_add(volatile _Atomic_word* __mem, int __val);
} // namespace __gnu_cxx
#endif
【问题讨论】:
-
atomicity.h 不是 C++ STL 的一部分...
-
您的包含保护表明您正在查看 C++ 标准库的 GCC 实现,不是 STL。那么,您是在寻找 STL 中的
atomicity.h标头,还是在 GCC C++ 标准库中寻找其他东西? C++ 标准库没有定义atomicity.h标头,但实现很可能有一个。