diff options
| author | Spencer T Brody <spencer@mongodb.com> | 2015-06-05 16:58:54 -0400 |
|---|---|---|
| committer | Spencer T Brody <spencer@mongodb.com> | 2015-06-11 11:22:38 -0400 |
| commit | 3df64b1cf1ca166acf933e2ba00028c0b3bbe54d (patch) | |
| tree | 4a87410c00d3850f41344cda7653a3d0f4d10174 /src/mongo/executor/task_executor.cpp | |
| parent | 8990721add6d19a6228132be6f837f48b4391243 (diff) | |
| download | mongo-3df64b1cf1ca166acf933e2ba00028c0b3bbe54d.tar.gz | |
SERVER-18623 Make ReplicationExecutor implement the TaskExecutor interface
Diffstat (limited to 'src/mongo/executor/task_executor.cpp')
| -rw-r--r-- | src/mongo/executor/task_executor.cpp | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/src/mongo/executor/task_executor.cpp b/src/mongo/executor/task_executor.cpp index b5d3ae09723..b7f1e4f99bf 100644 --- a/src/mongo/executor/task_executor.cpp +++ b/src/mongo/executor/task_executor.cpp @@ -39,12 +39,14 @@ namespace executor { TaskExecutor::CallbackState::CallbackState() = default; TaskExecutor::CallbackState::~CallbackState() = default; + TaskExecutor::CallbackHandle::CallbackHandle() = default; TaskExecutor::CallbackHandle::CallbackHandle(std::shared_ptr<CallbackState> callback) : _callback(std::move(callback)) {} TaskExecutor::EventState::EventState() = default; TaskExecutor::EventState::~EventState() = default; + TaskExecutor::EventHandle::EventHandle() = default; TaskExecutor::EventHandle::EventHandle(std::shared_ptr<EventState> event) : _event(std::move(event)) {} @@ -72,28 +74,22 @@ namespace executor { TaskExecutor::CallbackState* TaskExecutor::getCallbackFromHandle( const CallbackHandle& cbHandle) { - return cbHandle.getCallbackState(); + return cbHandle.getCallback(); } TaskExecutor::EventState* TaskExecutor::getEventFromHandle(const EventHandle& eventHandle) { - return eventHandle.getEventState(); + return eventHandle.getEvent(); } - void TaskExecutor::signalEvent(const EventHandle& event) { - getEventFromHandle(event)->signal(); + void TaskExecutor::setEventForHandle(EventHandle* eventHandle, + std::shared_ptr<EventState> event) { + eventHandle->setEvent(std::move(event)); } - void TaskExecutor::waitForEvent(const EventHandle& event) { - getEventFromHandle(event)->waitUntilSignaled(); + void TaskExecutor::setCallbackForHandle(CallbackHandle* cbHandle, + std::shared_ptr<CallbackState> callback) { + cbHandle->setCallback(std::move(callback)); } - void TaskExecutor::cancel(const CallbackHandle& cbHandle) { - getCallbackFromHandle(cbHandle)->cancel(); - }; - - void TaskExecutor::wait(const CallbackHandle& cbHandle) { - getCallbackFromHandle(cbHandle)->waitForCompletion(); - }; - } // namespace executor } // namespace mongo |
