Commit 77e5e1b5 authored by Kirk Shoop's avatar Kirk Shoop Committed by Facebook Github Bot

change abort to terminate

Summary: search replace abort with terminate to fix build errors

Reviewed By: yfeldblum

Differential Revision: D13106734

fbshipit-source-id: 146367a7fdbed9c945cb32cfdcb5ac521a1c861b
parent f3260585
...@@ -48,7 +48,7 @@ struct countdown { ...@@ -48,7 +48,7 @@ struct countdown {
void value(ExecutorRef exec); void value(ExecutorRef exec);
template <class E> template <class E>
void error(E e) { void error(E e) {
std::abort(); std::terminate();
} }
void done() {} void done() {}
PUSHMI_TEMPLATE(class Up) PUSHMI_TEMPLATE(class Up)
......
...@@ -78,7 +78,7 @@ struct ignoreVF { ...@@ -78,7 +78,7 @@ struct ignoreVF {
struct abortEF { struct abortEF {
[[noreturn]] [[noreturn]]
void operator()(detail::any) noexcept { void operator()(detail::any) noexcept {
std::abort(); std::terminate();
} }
}; };
...@@ -115,6 +115,7 @@ struct priorityZeroF { ...@@ -115,6 +115,7 @@ struct priorityZeroF {
struct passDVF { struct passDVF {
PUSHMI_TEMPLATE(class Data, class... VN) PUSHMI_TEMPLATE(class Data, class... VN)
// (requires True<>) //
(requires requires ( (requires requires (
set_value(std::declval<Data&>(), std::declval<VN>()...) set_value(std::declval<Data&>(), std::declval<VN>()...)
) && Receiver<Data>) ) && Receiver<Data>)
......
...@@ -27,7 +27,7 @@ struct no_fail_fn { ...@@ -27,7 +27,7 @@ struct no_fail_fn {
private: private:
struct on_error_impl { struct on_error_impl {
[[noreturn]] void operator()(any, any) noexcept { [[noreturn]] void operator()(any, any) noexcept {
std::abort(); std::terminate();
} }
}; };
template <class In> template <class In>
......
...@@ -124,25 +124,25 @@ public: ...@@ -124,25 +124,25 @@ public:
return *this; return *this;
} }
void value(VN... vn) { void value(VN... vn) {
if (!started_) {std::abort();} if (!started_) {std::terminate();}
if (done_){ return; } if (done_){ return; }
vptr_->value_(data_, std::move(vn)...); vptr_->value_(data_, std::move(vn)...);
} }
void error(E e) noexcept { void error(E e) noexcept {
if (!started_) {std::abort();} if (!started_) {std::terminate();}
if (done_){ return; } if (done_){ return; }
done_ = true; done_ = true;
vptr_->error_(data_, std::move(e)); vptr_->error_(data_, std::move(e));
} }
void done() { void done() {
if (!started_) {std::abort();} if (!started_) {std::terminate();}
if (done_){ return; } if (done_){ return; }
done_ = true; done_ = true;
vptr_->done_(data_); vptr_->done_(data_);
} }
void starting(any_receiver<PE, PV> up) { void starting(any_receiver<PE, PV> up) {
if (started_) {std::abort();} if (started_) {std::terminate();}
started_ = true; started_ = true;
vptr_->starting_(data_, std::move(up)); vptr_->starting_(data_, std::move(up));
} }
...@@ -196,7 +196,7 @@ class flow_receiver<VF, EF, DF, StrtF> { ...@@ -196,7 +196,7 @@ class flow_receiver<VF, EF, DF, StrtF> {
PUSHMI_TEMPLATE (class V) PUSHMI_TEMPLATE (class V)
(requires Invocable<VF&, V>) (requires Invocable<VF&, V>)
void value(V&& v) { void value(V&& v) {
if (!started_) {std::abort();} if (!started_) {std::terminate();}
if (done_){ return; } if (done_){ return; }
nf_((V&&) v); nf_((V&&) v);
} }
...@@ -204,13 +204,13 @@ class flow_receiver<VF, EF, DF, StrtF> { ...@@ -204,13 +204,13 @@ class flow_receiver<VF, EF, DF, StrtF> {
(requires Invocable<EF&, E>) (requires Invocable<EF&, E>)
void error(E e) noexcept { void error(E e) noexcept {
static_assert(NothrowInvocable<EF&, E>, "error function must be noexcept"); static_assert(NothrowInvocable<EF&, E>, "error function must be noexcept");
if (!started_) {std::abort();} if (!started_) {std::terminate();}
if (done_){ return; } if (done_){ return; }
done_ = true; done_ = true;
ef_(std::move(e)); ef_(std::move(e));
} }
void done() { void done() {
if (!started_) {std::abort();} if (!started_) {std::terminate();}
if (done_){ return; } if (done_){ return; }
done_ = true; done_ = true;
df_(); df_();
...@@ -218,7 +218,7 @@ class flow_receiver<VF, EF, DF, StrtF> { ...@@ -218,7 +218,7 @@ class flow_receiver<VF, EF, DF, StrtF> {
PUSHMI_TEMPLATE(class Up) PUSHMI_TEMPLATE(class Up)
(requires Invocable<StrtF&, Up&&>) (requires Invocable<StrtF&, Up&&>)
void starting(Up&& up) { void starting(Up&& up) {
if (started_) {std::abort();} if (started_) {std::terminate();}
started_ = true; started_ = true;
strtf_( (Up &&) up); strtf_( (Up &&) up);
} }
...@@ -276,7 +276,7 @@ class flow_receiver<Data, DVF, DEF, DDF, DStrtF> { ...@@ -276,7 +276,7 @@ class flow_receiver<Data, DVF, DEF, DDF, DStrtF> {
PUSHMI_TEMPLATE (class V) PUSHMI_TEMPLATE (class V)
(requires Invocable<DVF&, Data&, V>) (requires Invocable<DVF&, Data&, V>)
void value(V&& v) { void value(V&& v) {
if (!started_) {std::abort();} if (!started_) {std::terminate();}
if (done_){ return; } if (done_){ return; }
nf_(data_, (V&&) v); nf_(data_, (V&&) v);
} }
...@@ -285,13 +285,13 @@ class flow_receiver<Data, DVF, DEF, DDF, DStrtF> { ...@@ -285,13 +285,13 @@ class flow_receiver<Data, DVF, DEF, DDF, DStrtF> {
void error(E&& e) noexcept { void error(E&& e) noexcept {
static_assert( static_assert(
NothrowInvocable<DEF&, Data&, E>, "error function must be noexcept"); NothrowInvocable<DEF&, Data&, E>, "error function must be noexcept");
if (!started_) {std::abort();} if (!started_) {std::terminate();}
if (done_){ return; } if (done_){ return; }
done_ = true; done_ = true;
ef_(data_, (E&&) e); ef_(data_, (E&&) e);
} }
void done() { void done() {
if (!started_) {std::abort();} if (!started_) {std::terminate();}
if (done_){ return; } if (done_){ return; }
done_ = true; done_ = true;
df_(data_); df_(data_);
...@@ -299,7 +299,7 @@ class flow_receiver<Data, DVF, DEF, DDF, DStrtF> { ...@@ -299,7 +299,7 @@ class flow_receiver<Data, DVF, DEF, DDF, DStrtF> {
PUSHMI_TEMPLATE (class Up) PUSHMI_TEMPLATE (class Up)
(requires Invocable<DStrtF&, Data&, Up&&>) (requires Invocable<DStrtF&, Data&, Up&&>)
void starting(Up&& up) { void starting(Up&& up) {
if (started_) {std::abort();} if (started_) {std::terminate();}
started_ = true; started_ = true;
strtf_(data_, (Up &&) up); strtf_(data_, (Up &&) up);
} }
......
...@@ -125,7 +125,7 @@ TEST(JustIntSingleSender, TransformAndSubmit) { ...@@ -125,7 +125,7 @@ TEST(JustIntSingleSender, TransformAndSubmit) {
return v + 1; return v + 1;
}, },
[&](auto v) { [&](auto v) {
std::abort(); std::terminate();
return v; return v;
}) | }) |
op::transform([&](int v) { op::transform([&](int v) {
...@@ -175,7 +175,7 @@ TEST(FromIntManySender, TransformAndSubmit) { ...@@ -175,7 +175,7 @@ TEST(FromIntManySender, TransformAndSubmit) {
return v + 1; return v + 1;
}, },
[&](auto v) { [&](auto v) {
std::abort(); std::terminate();
return v; return v;
}) | }) |
op::transform([&](int v) { op::transform([&](int v) {
......
...@@ -131,7 +131,7 @@ class time_source_queue : public time_source_queue_base<E, TP> { ...@@ -131,7 +131,7 @@ class time_source_queue : public time_source_queue_base<E, TP> {
if (s->t_.get_id() == std::this_thread::get_id()) { if (s->t_.get_id() == std::this_thread::get_id()) {
// Executor is not allowed to use the time_source thread // Executor is not allowed to use the time_source thread
std::abort(); std::terminate();
} }
// //
...@@ -144,7 +144,7 @@ class time_source_queue : public time_source_queue_base<E, TP> { ...@@ -144,7 +144,7 @@ class time_source_queue : public time_source_queue_base<E, TP> {
std::unique_lock<std::mutex> guard{s->lock_}; std::unique_lock<std::mutex> guard{s->lock_};
if (!this->dispatching_ || this->pending_) { if (!this->dispatching_ || this->pending_) {
std::abort(); std::terminate();
} }
if (this->heap_.empty()) { if (this->heap_.empty()) {
...@@ -191,7 +191,7 @@ class time_source_queue : public time_source_queue_base<E, TP> { ...@@ -191,7 +191,7 @@ class time_source_queue : public time_source_queue_base<E, TP> {
std::unique_lock<std::mutex> guard{s->lock_}; std::unique_lock<std::mutex> guard{s->lock_};
if (!this->dispatching_ || this->pending_) { if (!this->dispatching_ || this->pending_) {
std::abort(); std::terminate();
} }
while (!this->heap_.empty()) { while (!this->heap_.empty()) {
...@@ -209,7 +209,7 @@ class time_source_queue : public time_source_queue_base<E, TP> { ...@@ -209,7 +209,7 @@ class time_source_queue : public time_source_queue_base<E, TP> {
std::unique_lock<std::mutex> guard{s->lock_}; std::unique_lock<std::mutex> guard{s->lock_};
if (!this->dispatching_ || this->pending_) { if (!this->dispatching_ || this->pending_) {
std::abort(); std::terminate();
} }
this->dispatching_ = false; this->dispatching_ = false;
...@@ -307,7 +307,7 @@ class time_source_shared : public time_source_shared_base<E, TP> { ...@@ -307,7 +307,7 @@ class time_source_shared : public time_source_shared_base<E, TP> {
// not allowed to be discarded without joining and completing all queued // not allowed to be discarded without joining and completing all queued
// items // items
if (t_.joinable() || this->items_ != 0) { if (t_.joinable() || this->items_ != 0) {
std::abort(); std::terminate();
} }
} }
time_source_shared() {} time_source_shared() {}
...@@ -415,7 +415,7 @@ class time_source_shared : public time_source_shared_base<E, TP> { ...@@ -415,7 +415,7 @@ class time_source_shared : public time_source_shared_base<E, TP> {
// once join() is called, new work queued to the executor is not safe unless // once join() is called, new work queued to the executor is not safe unless
// it is nested in an existing item. // it is nested in an existing item.
if (!!this->joined_) { if (!!this->joined_) {
std::abort(); std::terminate();
}; };
queue->heap_.push(std::move(item)); queue->heap_.push(std::move(item));
......
...@@ -130,7 +130,7 @@ class trampoline { ...@@ -130,7 +130,7 @@ class trampoline {
template <class Selector, class Derived> template <class Selector, class Derived>
static void submit(Selector, Derived&, recurse_t) { static void submit(Selector, Derived&, recurse_t) {
if (!is_owned()) { if (!is_owned()) {
abort(); std::terminate();
} }
repeat(*owner()) = true; repeat(*owner()) = true;
} }
...@@ -185,19 +185,19 @@ class trampoline { ...@@ -185,19 +185,19 @@ class trampoline {
pending(pending_store).clear(); pending(pending_store).clear();
if (!is_owned()) { if (!is_owned()) {
std::abort(); std::terminate();
} }
if (!pending(pending_store).empty()) { if (!pending(pending_store).empty()) {
std::abort(); std::terminate();
} }
owner() = nullptr; owner() = nullptr;
throw; throw;
} }
if (!is_owned()) { if (!is_owned()) {
std::abort(); std::terminate();
} }
if (!pending(pending_store).empty()) { if (!pending(pending_store).empty()) {
std::abort(); std::terminate();
} }
owner() = nullptr; owner() = nullptr;
} }
...@@ -247,7 +247,7 @@ class trampoline { ...@@ -247,7 +247,7 @@ class trampoline {
template <class E = std::exception_ptr> template <class E = std::exception_ptr>
detail::trampoline_id get_trampoline_id() { detail::trampoline_id get_trampoline_id() {
if (!detail::trampoline<E>::is_owned()) { if (!detail::trampoline<E>::is_owned()) {
std::abort(); std::terminate();
} }
return detail::trampoline<E>::get_id(); return detail::trampoline<E>::get_id();
} }
...@@ -282,7 +282,7 @@ decltype(auto) repeat(delegator<E>& exec) { ...@@ -282,7 +282,7 @@ decltype(auto) repeat(delegator<E>& exec) {
} }
template <class AnyExec> template <class AnyExec>
[[noreturn]] void repeat(AnyExec&) { [[noreturn]] void repeat(AnyExec&) {
std::abort(); std::terminate();
} }
} // namespace detail } // namespace detail
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment