Skip to content

Commit 3b5e46a

Browse files
committed
Rename task_state::exception to failed
1 parent d81c4ea commit 3b5e46a

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

include/task_future.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ enum class task_state {
1717
/// Task is ready and the result value is readily available
1818
ready,
1919
/// Task failed with an exception
20-
exception,
20+
failed,
2121
};
2222

2323
namespace detail {
@@ -48,7 +48,7 @@ class task_future_base {
4848
void set_exception(std::exception_ptr exception) {
4949
{
5050
std::lock_guard<std::mutex> lock(mutex);
51-
state = task_state::exception;
51+
state = task_state::failed;
5252
this->exception = exception;
5353
}
5454
condition_variable.notify_all();
@@ -84,7 +84,7 @@ class task_future_base {
8484
{
8585
}
8686
task_future_base(private_construct, std::exception_ptr exception)
87-
: state(task_state::exception)
87+
: state(task_state::failed)
8888
, exception(exception)
8989
{
9090
}
@@ -123,7 +123,7 @@ class task_future : public task_future_base, public std::enable_shared_from_this
123123
static std::shared_ptr<task_future> create_ready(T&& value) {
124124
return std::make_shared<task_future>(private_construct{}, std::move(value));
125125
}
126-
static std::shared_ptr<task_future> create_exception(std::exception_ptr exception) {
126+
static std::shared_ptr<task_future> create_failed(std::exception_ptr exception) {
127127
return std::make_shared<task_future>(private_construct{}, exception);
128128
}
129129
template<typename F>
@@ -133,7 +133,7 @@ class task_future : public task_future_base, public std::enable_shared_from_this
133133
return create_ready(std::move(value));
134134
}
135135
DISPATCH_QUEUE_CATCH(...) {
136-
return create_exception(std::current_exception());
136+
return create_failed(std::current_exception());
137137
}
138138
}
139139

@@ -220,7 +220,7 @@ class task_future<void> : public task_future_base, public std::enable_shared_fro
220220
static std::shared_ptr<task_future> create_ready() {
221221
return std::make_shared<task_future>(private_construct{}, task_state::ready);
222222
}
223-
static std::shared_ptr<task_future> create_exception(std::exception_ptr exception) {
223+
static std::shared_ptr<task_future> create_failed(std::exception_ptr exception) {
224224
return std::make_shared<task_future>(private_construct{}, exception);
225225
}
226226
template<typename F>
@@ -230,7 +230,7 @@ class task_future<void> : public task_future_base, public std::enable_shared_fro
230230
return create_ready();
231231
}
232232
DISPATCH_QUEUE_CATCH(...) {
233-
return create_exception(std::current_exception());
233+
return create_failed(std::current_exception());
234234
}
235235
}
236236

0 commit comments

Comments
 (0)