Mercurial > hg > CbC > CbC_llvm
comparison unittests/Support/ThreadPool.cpp @ 120:1172e4bd9c6f
update 4.0.0
author | mir3636 |
---|---|
date | Fri, 25 Nov 2016 19:14:25 +0900 |
parents | 7d135dc70f03 |
children | 803732b1fca8 |
comparison
equal
deleted
inserted
replaced
101:34baf5011add | 120:1172e4bd9c6f |
---|---|
29 protected: | 29 protected: |
30 // This is intended for platform as a temporary "XFAIL" | 30 // This is intended for platform as a temporary "XFAIL" |
31 bool isUnsupportedOSOrEnvironment() { | 31 bool isUnsupportedOSOrEnvironment() { |
32 Triple Host(Triple::normalize(sys::getProcessTriple())); | 32 Triple Host(Triple::normalize(sys::getProcessTriple())); |
33 | 33 |
34 if (std::find(UnsupportedEnvironments.begin(), UnsupportedEnvironments.end(), | 34 if (find(UnsupportedEnvironments, Host.getEnvironment()) != |
35 Host.getEnvironment()) != UnsupportedEnvironments.end()) | 35 UnsupportedEnvironments.end()) |
36 return true; | 36 return true; |
37 | 37 |
38 if (std::find(UnsupportedOSs.begin(), UnsupportedOSs.end(), Host.getOS()) | 38 if (is_contained(UnsupportedOSs, Host.getOS())) |
39 != UnsupportedOSs.end()) | |
40 return true; | 39 return true; |
41 | 40 |
42 if (std::find(UnsupportedArchs.begin(), UnsupportedArchs.end(), Host.getArch()) | 41 if (is_contained(UnsupportedArchs, Host.getArch())) |
43 != UnsupportedArchs.end()) | |
44 return true; | 42 return true; |
45 | 43 |
46 return false; | 44 return false; |
47 } | 45 } |
48 | 46 |
133 ASSERT_EQ(2, i.load()); | 131 ASSERT_EQ(2, i.load()); |
134 } | 132 } |
135 | 133 |
136 TEST_F(ThreadPoolTest, GetFuture) { | 134 TEST_F(ThreadPoolTest, GetFuture) { |
137 CHECK_UNSUPPORTED(); | 135 CHECK_UNSUPPORTED(); |
138 ThreadPool Pool; | 136 ThreadPool Pool{2}; |
139 std::atomic_int i{0}; | 137 std::atomic_int i{0}; |
140 Pool.async([this, &i] { | 138 Pool.async([this, &i] { |
141 waitForMainThread(); | 139 waitForMainThread(); |
142 ++i; | 140 ++i; |
143 }); | 141 }); |