diff options
author | IJsbrand Wijnands <ice@cisco.com> | 2019-10-08 13:50:55 +0200 |
---|---|---|
committer | IJsbrand Wijnands <iwijnand@cisco.com> | 2019-10-08 16:40:19 +0200 |
commit | 8229580e8da0db31503ce5c02371561582e73d02 (patch) | |
tree | 8a80795c2d1463173aecdfe69b0e56d21df9d0a8 /src/vlibmemory/memory_client.c | |
parent | 6be55648334308d4eaa4a02143b968720bb62078 (diff) |
api: add bapi thread handle to api main structure.
Adding the thread handle to the api main structure allows the client process of
the bin api to manage the thread, like setting the thread name for example.
Type: feature
Change-Id: I38b58ddc83d5958c4bda76eadd371eee1545724b
Signed-off-by: IJsbrand Wijnands <ice@cisco.com>
Diffstat (limited to 'src/vlibmemory/memory_client.c')
-rw-r--r-- | src/vlibmemory/memory_client.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/vlibmemory/memory_client.c b/src/vlibmemory/memory_client.c index f032ae77d19..25c01f18e80 100644 --- a/src/vlibmemory/memory_client.c +++ b/src/vlibmemory/memory_client.c @@ -394,6 +394,7 @@ connect_to_vlib_internal (const char *svm_name, { int rv = 0; memory_client_main_t *mm = &memory_client_main; + api_main_t *am = &api_main; if (do_map && (rv = vl_client_api_map (svm_name))) { @@ -415,7 +416,14 @@ connect_to_vlib_internal (const char *svm_name, rv = pthread_create (&mm->rx_thread_handle, NULL /*attr */ , rx_thread_fn, 0); if (rv) - clib_warning ("pthread_create returned %d", rv); + { + clib_warning ("pthread_create returned %d", rv); + am->rx_thread_handle = 0; + } + else + { + am->rx_thread_handle = mm->rx_thread_handle; + } } mm->connected_to_vlib = 1; |