@@ -783,7 +783,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__set_once_functor_lock_ptr(&__functor_lock);
#endif
- int __e = __gthread_once(&(__once._M_once), &__once_proxy);
+ int __e = __gthread_once(&__once._M_once, &__once_proxy);
#ifndef _GLIBCXX_HAVE_TLS
if (__functor_lock)
@@ -24,6 +24,7 @@
#include <mutex>
+#include <thread>
#include <system_error>
#include <testsuite_hooks.h>
@@ -38,15 +39,18 @@ int main()
m.lock();
bool b;
- try
- {
- b = m.try_lock();
- VERIFY( !b );
- }
- catch (const std::system_error& e)
- {
- VERIFY( false );
- }
+ std::thread t([&] {
+ try
+ {
+ b = m.try_lock();
+ }
+ catch (const std::system_error& e)
+ {
+ VERIFY( false );
+ }
+ });
+ t.join();
+ VERIFY( !b );
m.unlock();
}