[futures.shared_future]

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@112990 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Howard Hinnant
2010-09-03 18:39:25 +00:00
parent ae153b9855
commit 99be8237db
13 changed files with 1077 additions and 2 deletions

View File

@@ -240,4 +240,21 @@ promise<void>::set_exception_at_thread_exit(exception_ptr __p)
__state_->set_exception_at_thread_exit(__p);
}
shared_future<void>::~shared_future()
{
if (__state_)
__state_->__release_shared();
}
shared_future<void>&
shared_future<void>::operator=(const shared_future& __rhs)
{
if (__rhs.__state_)
__rhs.__state_->__add_shared();
if (__state_)
__state_->__release_shared();
__state_ = __rhs.__state_;
return *this;
}
_LIBCPP_END_NAMESPACE_STD