summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/task_runner.h
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2018-10-31 15:42:17 -0400
committerMathias Stearn <mathias@10gen.com>2018-11-15 17:25:11 -0500
commit3d7ed4fdd5e4840e9599a74ec92e16bc619bebf0 (patch)
tree2bd06655367af012e17bf80947cdb792fa1b9b44 /src/mongo/db/repl/task_runner.h
parent1ded7067e2d1a6161b15e5a462f8cba2d755c9a6 (diff)
downloadmongo-3d7ed4fdd5e4840e9599a74ec92e16bc619bebf0.tar.gz
SERVER-35682 kill existing SharedPromise type
This required plumbing unique_function into many more places.
Diffstat (limited to 'src/mongo/db/repl/task_runner.h')
-rw-r--r--src/mongo/db/repl/task_runner.h15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/mongo/db/repl/task_runner.h b/src/mongo/db/repl/task_runner.h
index 6875229bb9e..85313cc4ce9 100644
--- a/src/mongo/db/repl/task_runner.h
+++ b/src/mongo/db/repl/task_runner.h
@@ -38,6 +38,7 @@
#include "mongo/stdx/functional.h"
#include "mongo/stdx/mutex.h"
#include "mongo/util/concurrency/thread_pool.h"
+#include "mongo/util/functional.h"
namespace mongo {
@@ -60,17 +61,7 @@ public:
kCancel = 3,
};
- using Task = stdx::function<NextAction(OperationContext*, const Status&)>;
- using SynchronousTask = stdx::function<Status(OperationContext* opCtx)>;
-
- /**
- * Returns the Status from the supplied function after running it..
- *
- * Note: TaskRunner::NextAction controls when the operation context and thread will be released.
- */
- Status runSynchronousTask(
- SynchronousTask func,
- TaskRunner::NextAction nextAction = TaskRunner::NextAction::kKeepOperationContext);
+ using Task = unique_function<NextAction(OperationContext*, const Status&)>;
/**
* Creates a Task returning kCancel. This is useful in shutting down the task runner after
@@ -126,7 +117,7 @@ public:
* immediately. This is usually the case when the task runner is canceled. Accessing the
* operation context in the task will result in undefined behavior.
*/
- void schedule(const Task& task);
+ void schedule(Task task);
/**
* If there is a task that is already running, allows the task to run to completion.