From c520baeebf02e4adeb088e7cb5b46cc9f826bd57 Mon Sep 17 00:00:00 2001 From: Yogesh Pande Date: Tue, 22 May 2018 16:44:40 +0300 Subject: [PATCH] Remove ns_event_loop_thread_start() from NDInterface and ThreadInterface connect(). ns_event_loop_thread_start() is incorrectly used at connect() phase, the initial setup is already done at init() phase and the eventloop thread is correctly initialized. Also, the usage of ns_event_loop_thread_start() API should be behind MBED_CONF_NANOSTACK_HAL_EVENT_LOOP_DISPATCH_FROM_APPLICATION flag as application can decide to use main thread for event loop, which will result in linker error for this API call in case of ARMCC compiler. --- features/nanostack/mbed-mesh-api/source/nd_tasklet.c | 1 - features/nanostack/mbed-mesh-api/source/thread_tasklet.c | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/features/nanostack/mbed-mesh-api/source/nd_tasklet.c b/features/nanostack/mbed-mesh-api/source/nd_tasklet.c index 1eaa785f09..06ce3290e1 100644 --- a/features/nanostack/mbed-mesh-api/source/nd_tasklet.c +++ b/features/nanostack/mbed-mesh-api/source/nd_tasklet.c @@ -398,7 +398,6 @@ int8_t nd_tasklet_connect(mesh_interface_cb callback, int8_t nwk_interface_id) // -2 memory allocation failure return tasklet_data_ptr->tasklet; } - ns_event_loop_thread_start(); } else { tasklet_data_ptr->tasklet = tasklet_id; mesh_system_send_connect_event(tasklet_data_ptr->tasklet); diff --git a/features/nanostack/mbed-mesh-api/source/thread_tasklet.c b/features/nanostack/mbed-mesh-api/source/thread_tasklet.c index d16271d13c..5f717ede6f 100644 --- a/features/nanostack/mbed-mesh-api/source/thread_tasklet.c +++ b/features/nanostack/mbed-mesh-api/source/thread_tasklet.c @@ -431,9 +431,7 @@ int8_t thread_tasklet_connect(mesh_interface_cb callback, int8_t nwk_interface_i // -1 handler already used by other tasklet // -2 memory allocation failure return thread_tasklet_data_ptr->tasklet; - } - - ns_event_loop_thread_start(); + } } else { thread_tasklet_data_ptr->tasklet = tasklet; mesh_system_send_connect_event(thread_tasklet_data_ptr->tasklet);