mirror of git://gcc.gnu.org/git/gcc.git
Rename shadowed variable in libstdc++ test.
* testsuite/30_threads/timed_mutex/try_lock_until/57641.cc: Rename shadowed variable. From-SVN: r227519
This commit is contained in:
parent
d835619658
commit
2d5e3740fd
|
|
@ -1,5 +1,8 @@
|
||||||
2015-09-07 Jonathan Wakely <jwakely@redhat.com>
|
2015-09-07 Jonathan Wakely <jwakely@redhat.com>
|
||||||
|
|
||||||
|
* testsuite/30_threads/timed_mutex/try_lock_until/57641.cc: Rename
|
||||||
|
shadowed variable.
|
||||||
|
|
||||||
* testsuite/30_threads/recursive_timed_mutex/unlock/2.cc: Run on
|
* testsuite/30_threads/recursive_timed_mutex/unlock/2.cc: Run on
|
||||||
darwin.
|
darwin.
|
||||||
* testsuite/30_threads/timed_mutex/unlock/2.cc: Run on darwin.
|
* testsuite/30_threads/timed_mutex/unlock/2.cc: Run on darwin.
|
||||||
|
|
|
||||||
|
|
@ -48,21 +48,21 @@ struct clock
|
||||||
};
|
};
|
||||||
|
|
||||||
std::timed_mutex mx;
|
std::timed_mutex mx;
|
||||||
bool test = false;
|
bool locked = false;
|
||||||
|
|
||||||
void f()
|
void f()
|
||||||
{
|
{
|
||||||
test = mx.try_lock_until(clock::now() + C::milliseconds(1));
|
locked = mx.try_lock_until(clock::now() + C::milliseconds(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
bool test = false;
|
bool test __attribute__((unused)) = true;
|
||||||
std::lock_guard<std::timed_mutex> l(mx);
|
std::lock_guard<std::timed_mutex> l(mx);
|
||||||
auto start = C::system_clock::now();
|
auto start = C::system_clock::now();
|
||||||
std::thread t(f);
|
std::thread t(f);
|
||||||
t.join();
|
t.join();
|
||||||
auto stop = C::system_clock::now();
|
auto stop = C::system_clock::now();
|
||||||
VERIFY( (stop - start) < C::seconds(9) );
|
VERIFY( (stop - start) < C::seconds(9) );
|
||||||
VERIFY( !test );
|
VERIFY( !locked );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue