Commit 5d231c67 authored by Lee Howes's avatar Lee Howes Committed by Facebook GitHub Bot

Add back default SerialExecutor defaulted to getGlobalCPUExecutor.

Summary: Use the global immutable executor by default for SerialExecutor.

Reviewed By: yfeldblum

Differential Revision: D28925750

fbshipit-source-id: 91f75cfb3a4880098d933fe1f148d5c3b2e896e7
parent b66627fc
......@@ -57,7 +57,8 @@ class SerialExecutor : public SequencedExecutor {
SerialExecutor(SerialExecutor&&) = delete;
SerialExecutor& operator=(SerialExecutor&&) = delete;
static KeepAlive<SerialExecutor> create(KeepAlive<Executor> parent);
static KeepAlive<SerialExecutor> create(
KeepAlive<Executor> parent = getGlobalCPUExecutor());
class Deleter {
public:
......
......@@ -179,8 +179,7 @@ TEST(SerialExecutor, RecursiveAddInline) {
}
TEST(SerialExecutor, ExecutionThrows) {
auto executor = SerialExecutor::create(folly::getKeepAliveToken(
folly::getUnsafeMutableGlobalCPUExecutor().get()));
auto executor = SerialExecutor::create();
// an empty Func will throw std::bad_function_call when invoked,
// but SerialExecutor should catch that exception
......
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