2
0
mirror of https://github.com/boostorg/thread.git synced 2026-01-27 19:32:11 +00:00

Add assertion on future continuation parameter is ready. As noted in #11256, there some serious issues with the parameter passed and with lock on locked mutextes :(.

This commit is contained in:
Vicente J. Botet Escriba
2015-05-02 16:29:06 +02:00
parent bce7eabba2
commit e598796eaf
6 changed files with 123 additions and 7 deletions

View File

@@ -27,8 +27,10 @@
#include <boost/assert.hpp>
#include <string>
#include <iostream>
#include <cassert>
boost::future<void> p(boost::future<void>) {
boost::future<void> p(boost::future<void> f) {
assert(f.is_ready());
return boost::make_ready_future();
}
@@ -156,10 +158,13 @@ int main()
&& defined BOOST_THREAD_PROVIDES_EXECUTORS \
&& ! defined BOOST_NO_CXX11_RVALUE_REFERENCES
boost::basic_thread_pool executor;
// compiles
boost::make_ready_future().then(&p);
boost::basic_thread_pool executor;
// ??
boost::make_ready_future().then(executor, &p);
// doesn't compile
boost::make_ready_future().then(executor, &p);
#endif