From 3fca567ff438145e28dd1318ad5b1734c1091257 Mon Sep 17 00:00:00 2001 From: Mohsin Kazmi Date: Thu, 4 Jan 2018 18:57:26 +0100 Subject: 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 --- src/vlibmemory/memory_shared.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/vlibmemory/memory_shared.c') diff --git a/src/vlibmemory/memory_shared.c b/src/vlibmemory/memory_shared.c index c9ace1b141d..5b7d735dab9 100644 --- a/src/vlibmemory/memory_shared.c +++ b/src/vlibmemory/memory_shared.c @@ -577,7 +577,7 @@ vl_map_shmem (const char *region_name, int is_vlib) mutex_ok: am->vlib_rp = vlib_rp; - while (svm_queue_sub (q, (u8 *) & old_msg, 1 /* nowait */ ) + while (svm_queue_sub (q, (u8 *) & old_msg, SVM_Q_NOWAIT, 0) != -2 /* queue underflow */ ) { vl_msg_api_free_nolock ((void *) old_msg); -- cgit 1.2.3-korg