18 #include <sys/types.h> 23 #include <unordered_set> 26 #include "gtest/gtest.h" 31 namespace base_internal {
36 <<
"NumCPUs() should not have the default value of 0";
40 #if !(defined(__aarch64__) && defined(__linux__)) && !defined(__EMSCRIPTEN__) 42 <<
"NominalCPUFrequency() did not return a reasonable value";
47 <<
"CPU frequency detection was fixed! Please update unittest.";
53 #ifdef __native_client__ 61 for (
int i = 0;
i < 32; ++
i) {
63 Barrier all_threads_done(kNumThreads);
64 std::vector<std::thread> threads;
67 std::unordered_set<pid_t> tids;
70 threads.push_back(std::thread([&]() {
73 MutexLock lock(&mutex);
74 ASSERT_TRUE(tids.find(
id) == tids.end());
80 all_threads_done.Block();
83 for (
auto& thread : threads) {
90 TEST(SysinfoTest, LinuxGetTID) {
92 EXPECT_EQ(
GetTID(), getpid());
TEST(NotificationTest, SanityTest)
double NominalCPUFrequency()
constexpr int32_t kNumThreads