summaryrefslogtreecommitdiffstats
path: root/src/vpp-api/vapi/vapi.h
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2018-01-04 18:57:26 +0100
committerDave Barach <openvpp@barachs.net>2018-01-22 18:17:23 +0000
commit3fca567ff438145e28dd1318ad5b1734c1091257 (patch)
tree7101b4ae130f2731e549f82ab98af8bfbabc6571 /src/vpp-api/vapi/vapi.h
parente82488f10f20f464961c5c7b381b4a419bca0bbc (diff)
svm: queue sub: Add conditional timed wait
On reviece side svm queue only permits blocking and non-blocking calls. This patch adds timed wait blocking functionality which returns either on signal/event or on given time out. It also preserves the original behavior, so it will not hurt client applications which are using svm queue. Change-Id: Ic10632170330a80afb8bc781d4ccddfe4da2c69a Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Diffstat (limited to 'src/vpp-api/vapi/vapi.h')
-rw-r--r--src/vpp-api/vapi/vapi.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/vpp-api/vapi/vapi.h b/src/vpp-api/vapi/vapi.h
index 245bf654e8a..fc48e7d402c 100644
--- a/src/vpp-api/vapi/vapi.h
+++ b/src/vpp-api/vapi/vapi.h
@@ -22,6 +22,7 @@
#include <stdbool.h>
#include <vppinfra/types.h>
#include <vapi/vapi_common.h>
+#include <svm/queue.h>
#ifdef __cplusplus
extern "C"
@@ -162,10 +163,13 @@ extern "C"
* @param ctx opaque vapi context
* @param[out] msg pointer to result variable containing message
* @param[out] msg_size pointer to result variable containing message size
+ * @param cond enum type for blocking, non-blocking or timed wait call
+ * @param time in sec for timed wait
*
* @return VAPI_OK on success, other error code on error
*/
- vapi_error_e vapi_recv (vapi_ctx_t ctx, void **msg, size_t * msg_size);
+ vapi_error_e vapi_recv (vapi_ctx_t ctx, void **msg, size_t * msg_size,
+ svm_q_conditional_wait_t cond, u32 time);
/**
* @brief wait for connection to become readable or writable