From c560789ca85b2325072ef1a209d4b1012dfe07bd Mon Sep 17 00:00:00 2001 From: Ole Troan Date: Wed, 10 Apr 2019 19:32:02 +0200 Subject: API: Handle pthread cond signal case where signal is missed. Especially on a single core setup the RX thread could signal the main thread that it was done, before main thread listened to the signal. Change-Id: Ib70337b21bcf77787ce4ee0aa9cf80c6da2215af Signed-off-by: Ole Troan --- src/vlibmemory/memory_client.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/vlibmemory') diff --git a/src/vlibmemory/memory_client.c b/src/vlibmemory/memory_client.c index 383d7428b72..d002845a00c 100644 --- a/src/vlibmemory/memory_client.c +++ b/src/vlibmemory/memory_client.c @@ -100,8 +100,8 @@ static void vl_api_rx_thread_exit_t_handler (vl_api_rx_thread_exit_t * mp) { memory_client_main_t *mm = &memory_client_main; - vl_msg_api_free (mp); - longjmp (mm->rx_thread_jmpbuf, 1); + if (mm->rx_thread_jmpbuf_valid) + longjmp (mm->rx_thread_jmpbuf, 1); } static void -- cgit 1.2.3-korg