summaryrefslogtreecommitdiffstats
path: root/src/vpp-api/vom/rpc_cmd.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/vpp-api/vom/rpc_cmd.hpp')
-rw-r--r--src/vpp-api/vom/rpc_cmd.hpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/vpp-api/vom/rpc_cmd.hpp b/src/vpp-api/vom/rpc_cmd.hpp
index 60dbd47c8b3..ae3c6753d24 100644
--- a/src/vpp-api/vom/rpc_cmd.hpp
+++ b/src/vpp-api/vom/rpc_cmd.hpp
@@ -71,7 +71,16 @@ public:
/**
* Fulfill the commands promise. Called from the RX thread
*/
- void fulfill(const DATA& d) { m_promise.set_value(d); }
+ void fulfill(const DATA& d)
+ {
+ m_promise.set_value(d);
+
+ /*
+ * we reset the promise after setting the value to reuse it
+ * when we run the retire command from the same cmd object
+ */
+ m_promise = std::promise<DATA>();
+ }
/**
* Wait on the commands promise. i.e. block on the completion