Commit 48d8dd06 by Jonathan Wakely Committed by Jonathan Wakely

mutex (call_once): Store closure in __once_functor as bound function wrapper might not be copyable.

	* include/std/mutex (call_once): Store closure in __once_functor
	as bound function wrapper might not be copyable.

From-SVN: r181128
parent c5a0818e
2011-11-07 Jonathan Wakely <jwakely.gcc@gmail.com>
* include/std/mutex (call_once): Store closure in __once_functor
as bound function wrapper might not be copyable.
2011-11-07 Andrew MacLeod <amacleod@redhat.com> 2011-11-07 Andrew MacLeod <amacleod@redhat.com>
* include/bits/atomic_base.h (atomic_thread_fence): Revert. * include/bits/atomic_base.h (atomic_thread_fence): Revert.
......
...@@ -810,8 +810,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -810,8 +810,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__once_call = &__once_call_impl<decltype(__bound_functor)>; __once_call = &__once_call_impl<decltype(__bound_functor)>;
#else #else
unique_lock<mutex> __functor_lock(__get_once_mutex()); unique_lock<mutex> __functor_lock(__get_once_mutex());
__once_functor = std::__bind_simple(std::forward<_Callable>(__f), auto __callable = std::__bind_simple(std::forward<_Callable>(__f),
std::forward<_Args>(__args)...); std::forward<_Args>(__args)...);
__once_functor = [&]() { __callable(); };
__set_once_functor_lock_ptr(&__functor_lock); __set_once_functor_lock_ptr(&__functor_lock);
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment