net: lwm2m: fix hanging deregistration
Fixed a deadlock in deregistration by moving mutex unlocking. Signed-off-by: Tommi Kangas <tommi.kangas@nordicsemi.no>
This commit is contained in:
parent
50b57056bd
commit
75b5eaac0f
1 changed files with 2 additions and 1 deletions
|
@ -1354,11 +1354,12 @@ int lwm2m_rd_client_stop(struct lwm2m_ctx *client_ctx,
|
|||
|
||||
LOG_INF("Stop LWM2M Client: %s", client.ep_name);
|
||||
|
||||
k_mutex_unlock(&client.mutex);
|
||||
|
||||
while (get_sm_state() != ENGINE_IDLE) {
|
||||
k_sleep(K_MSEC(STATE_MACHINE_UPDATE_INTERVAL_MS / 2));
|
||||
}
|
||||
k_mutex_unlock(&client.mutex);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue