Skip to content

Commit

Permalink
Remove wait after callbacks are added for graphCallback
Browse files Browse the repository at this point in the history
Signed-off-by: methylDragon <methylDragon@gmail.com>
  • Loading branch information
methylDragon committed Nov 12, 2022
1 parent b7480f8 commit 3e38f8d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion fuse_core/include/fuse_core/callback_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class CallbackWrapper : public CallbackWrapperBase
/**
* @brief Call this function. This is used by the callback queue.
*/
void call()
void call() override
{
promise_.set_value(callback_());
}
Expand Down
4 changes: 2 additions & 2 deletions fuse_core/src/async_motion_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ void AsyncMotionModel::graphCallback(Graph::ConstSharedPtr graph)
auto callback = std::make_shared<CallbackWrapper<void>>(
std::bind(&AsyncMotionModel::onGraphUpdate, this, std::move(graph))
);
auto result = callback->getFuture();
// auto result = callback->getFuture(); // TODO(CH3): Circle back if we need this again
callback_queue_->addCallback(callback);
result.wait();
// result.wait();
}

void AsyncMotionModel::start()
Expand Down
4 changes: 1 addition & 3 deletions fuse_core/src/callback_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,7 @@ namespace fuse_core

void CallbackAdapter::removeAllCallbacks(){
std::lock_guard<std::mutex> lock(queue_mutex_);
while(!callback_queue_.empty()){
callback_queue_.clear();
}
callback_queue_.clear();
}


Expand Down

0 comments on commit 3e38f8d

Please sign in to comment.