forked from OSchip/llvm-project
parent
a140cba795
commit
3777a33d71
|
@ -44,8 +44,9 @@ int test1 = 0;
|
|||
int test2 = 0;
|
||||
|
||||
int runs = 0;
|
||||
bool expect_result = false;
|
||||
|
||||
void f(bool expect_result)
|
||||
void f()
|
||||
{
|
||||
typedef std::chrono::system_clock Clock;
|
||||
typedef std::chrono::milliseconds milliseconds;
|
||||
|
@ -73,8 +74,9 @@ void f(bool expect_result)
|
|||
int main()
|
||||
{
|
||||
{
|
||||
expect_result = true;
|
||||
L1 lk(m0);
|
||||
std::thread t(f, /*expect_result*/true);
|
||||
std::thread t(f);
|
||||
assert(test1 == 0);
|
||||
while (test1 == 0)
|
||||
cv.wait(lk);
|
||||
|
@ -87,8 +89,9 @@ int main()
|
|||
test1 = 0;
|
||||
test2 = 0;
|
||||
{
|
||||
expect_result = false;
|
||||
L1 lk(m0);
|
||||
std::thread t(f, /*expect_result*/false);
|
||||
std::thread t(f);
|
||||
assert(test1 == 0);
|
||||
while (test1 == 0)
|
||||
cv.wait(lk);
|
||||
|
|
|
@ -57,6 +57,7 @@ constexpr decltype(std::placeholders::_10) cp10 = std::placeholders::_10;
|
|||
#endif // TEST_STD_VER >= 11
|
||||
|
||||
void use_placeholders_to_prevent_unused_warning() {
|
||||
#if TEST_STD_VER >= 11
|
||||
((void)cp1);
|
||||
((void)cp2);
|
||||
((void)cp3);
|
||||
|
@ -77,6 +78,7 @@ void use_placeholders_to_prevent_unused_warning() {
|
|||
((void)default8);
|
||||
((void)default9);
|
||||
((void)default10);
|
||||
#endif
|
||||
}
|
||||
|
||||
int main()
|
||||
|
|
Loading…
Reference in New Issue