mirror of
https://github.com/boostorg/thread.git
synced 2026-01-26 07:02:12 +00:00
* [@http://svn.boost.org/trac/boost/ticket/6195 #6195] c++11 compliance: Provide the standard time related interface using Boost.Chrono. * [@http://svn.boost.org/trac/boost/ticket/6224 #6224] c++11 compliance: Add the use of standard noexcept on compilers supporting them. * [@http://svn.boost.org/trac/boost/ticket/6226 #6226] c++11 compliance: Add explicit bool conversion from locks. * [@http://svn.boost.org/trac/boost/ticket/6230 #6230] c++11 compliance: Follows the exception reporting mechanism as defined in the c++11. * [@http://svn.boost.org/trac/boost/ticket/6272 #6272] c++11 compliance: Add thread::id hash specialization. * [@http://svn.boost.org/trac/boost/ticket/6273 #6273] c++11 compliance: Add cv_status enum class and use it on the conditions wait functions. * [@http://svn.boost.org/trac/boost/ticket/6194 #6194] Adapt to Boost.Move. Fixed Bugs: * [@http://svn.boost.org/trac/boost/ticket/2575 #2575] Bug- Boost 1.36.0 on Itanium platform. * [@http://svn.boost.org/trac/boost/ticket/4921 #4921] BOOST_THREAD_USE_DLL and BOOST_THREAD_USE_LIB are crucial and need to be documented. * [@http://svn.boost.org/trac/boost/ticket/5013 #5013] documentation: boost:🧵 pthreas_exit causes terminate(). * [@http://svn.boost.org/trac/boost/ticket/5351 #5351] interrupt a future get boost::unknown_exception. * [@http://svn.boost.org/trac/boost/ticket/5516 #5516] Upgrade lock is not acquired when previous upgrade lock releases if another read lock is present. * [@http://svn.boost.org/trac/boost/ticket/5990 #5990] shared_future<T>::get() has wrong return type. * [@http://svn.boost.org/trac/boost/ticket/6174 #6174] packaged_task doesn't correctly handle moving results. [SVN r76543]
69 lines
1.8 KiB
C++
Executable File
69 lines
1.8 KiB
C++
Executable File
// (C) Copyright 2012 Vicente J. Botet Escriba
|
|
// Use, modification and distribution are subject to the
|
|
// Boost Software License, Version 1.0. (See accompanying file
|
|
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
|
|
#include <boost/thread/future.hpp>
|
|
|
|
namespace boost
|
|
{
|
|
|
|
namespace thread_detail
|
|
{
|
|
|
|
class future_error_category :
|
|
public boost::system::error_category
|
|
{
|
|
public:
|
|
virtual const char* name() const; //BOOST_NOEXCEPT;
|
|
virtual std::string message(int ev) const;
|
|
};
|
|
|
|
const char*
|
|
future_error_category::name() const //BOOST_NOEXCEPT
|
|
{
|
|
return "future";
|
|
}
|
|
|
|
std::string
|
|
future_error_category::message(int ev) const
|
|
{
|
|
switch (ev)
|
|
{
|
|
case future_errc::broken_promise:
|
|
return std::string("The associated promise has been destructed prior "
|
|
"to the associated state becoming ready.");
|
|
case future_errc::future_already_retrieved:
|
|
return std::string("The future has already been retrieved from "
|
|
"the promise or packaged_task.");
|
|
case future_errc::promise_already_satisfied:
|
|
return std::string("The state of the promise has already been set.");
|
|
case future_errc::no_state:
|
|
return std::string("Operation not permitted on an object without "
|
|
"an associated state.");
|
|
}
|
|
return std::string("unspecified future_errc value\n");
|
|
}
|
|
}
|
|
|
|
const system::error_category&
|
|
future_category()
|
|
{
|
|
static thread_detail::future_error_category f;
|
|
return f;
|
|
}
|
|
|
|
future_error::future_error(system::error_code ec)
|
|
: logic_error(ec.message()),
|
|
ec_(ec)
|
|
{
|
|
}
|
|
|
|
// future_error::~future_error() //BOOST_NOEXCEPT
|
|
// {
|
|
// }
|
|
|
|
|
|
|
|
}
|