aboutsummaryrefslogtreecommitdiffstats
path: root/src/vcl/vppcom.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vcl/vppcom.c')
-rw-r--r--src/vcl/vppcom.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/vcl/vppcom.c b/src/vcl/vppcom.c
index e180967339b..7fb8e9698d8 100644
--- a/src/vcl/vppcom.c
+++ b/src/vcl/vppcom.c
@@ -2850,6 +2850,19 @@ vppcom_session_read_ready (session_t * session, u32 session_index)
}
}
rv = ready;
+
+ if (vcm->app_event_queue->cursize &&
+ !pthread_mutex_trylock (&vcm->app_event_queue->mutex))
+ {
+ u32 i, n_to_dequeue = vcm->app_event_queue->cursize;
+ session_fifo_event_t e;
+
+ for (i = 0; i < n_to_dequeue; i++)
+ unix_shared_memory_queue_sub_raw (vcm->app_event_queue, (u8 *) & e);
+
+ pthread_mutex_unlock (&vcm->app_event_queue->mutex);
+ }
+
done:
return rv;
}