diff options
Diffstat (limited to 'src/vpp-api/vapi/vapi.c')
-rw-r--r-- | src/vpp-api/vapi/vapi.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/vpp-api/vapi/vapi.c b/src/vpp-api/vapi/vapi.c index 022f023aeb0..26c5708342f 100644 --- a/src/vpp-api/vapi/vapi.c +++ b/src/vpp-api/vapi/vapi.c @@ -1792,14 +1792,15 @@ vapi_verify_msg_size (vapi_msg_id_t id, void *buf, uword buf_size) } vapi_error_e -vapi_dispatch_one (vapi_ctx_t ctx) +vapi_dispatch_one_timedwait (vapi_ctx_t ctx, u32 wait_time) { VAPI_DBG ("vapi_dispatch_one()"); void *msg; uword size; svm_q_conditional_wait_t cond = - vapi_is_nonblocking (ctx) ? SVM_Q_NOWAIT : SVM_Q_WAIT; - vapi_error_e rv = vapi_recv (ctx, &msg, &size, cond, 0); + vapi_is_nonblocking (ctx) ? (wait_time ? SVM_Q_TIMEDWAIT : SVM_Q_NOWAIT) : + SVM_Q_WAIT; + vapi_error_e rv = vapi_recv (ctx, &msg, &size, cond, wait_time); if (VAPI_OK != rv) { VAPI_DBG ("vapi_recv failed with rv=%d", rv); @@ -1847,6 +1848,12 @@ done: } vapi_error_e +vapi_dispatch_one (vapi_ctx_t ctx) +{ + return vapi_dispatch_one_timedwait (ctx, 0); +} + +vapi_error_e vapi_dispatch (vapi_ctx_t ctx) { vapi_error_e rv = VAPI_OK; |