X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvlibmemory%2Fmemory_client.c;h=f032ae77d198aa7d85a70d47de39a8c2ee715166;hb=25fe57821;hp=383d7428b72f07cc177362f117bbbb8c2d558e37;hpb=2e1c8967faf4e9f7b45471df02e4e5b07fbb520a;p=vpp.git diff --git a/src/vlibmemory/memory_client.c b/src/vlibmemory/memory_client.c index 383d7428b72..f032ae77d19 100644 --- a/src/vlibmemory/memory_client.c +++ b/src/vlibmemory/memory_client.c @@ -63,7 +63,6 @@ rx_thread_fn (void *arg) svm_queue_t *q; memory_client_main_t *mm = &memory_client_main; api_main_t *am = &api_main; - int i; q = am->vl_input_queue; @@ -71,25 +70,7 @@ rx_thread_fn (void *arg) if (setjmp (mm->rx_thread_jmpbuf) == 0) { mm->rx_thread_jmpbuf_valid = 1; - /* - * Find an unused slot in the per-cpu-mheaps array, - * and grab it for this thread. We need to be able to - * push/pop the thread heap without affecting other thread(s). - */ - if (__os_thread_index == 0) - { - for (i = 0; i < ARRAY_LEN (clib_per_cpu_mheaps); i++) - { - if (clib_per_cpu_mheaps[i] == 0) - { - /* Copy the main thread mheap pointer */ - clib_per_cpu_mheaps[i] = clib_per_cpu_mheaps[0]; - __os_thread_index = i; - break; - } - } - ASSERT (__os_thread_index > 0); - } + clib_mem_set_thread_index (); while (1) vl_msg_api_queue_handler (q); } @@ -100,8 +81,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