summaryrefslogtreecommitdiffstats
path: root/libcxx/src
diff options
context:
space:
mode:
authorHoward Hinnant <hhinnant@apple.com>2010-09-03 18:39:25 +0000
committerHoward Hinnant <hhinnant@apple.com>2010-09-03 18:39:25 +0000
commitead85506a763516f78f3671cde20c22fb7143312 (patch)
treed1025205884fef58ba745b9c2b0032bdaf80ff76 /libcxx/src
parent03f4be86ba780e890a974da7cd5511491c3e6eac (diff)
downloadbcm5719-llvm-ead85506a763516f78f3671cde20c22fb7143312.tar.gz
bcm5719-llvm-ead85506a763516f78f3671cde20c22fb7143312.zip
[futures.shared_future]
llvm-svn: 112990
Diffstat (limited to 'libcxx/src')
-rw-r--r--libcxx/src/future.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/libcxx/src/future.cpp b/libcxx/src/future.cpp
index a0082767122..924a6846869 100644
--- a/libcxx/src/future.cpp
+++ b/libcxx/src/future.cpp
@@ -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
OpenPOWER on IntegriCloud