kopia lustrzana https://github.com/espressif/esp-idf
Merge branch 'bugfix/sntp_init_can_run_before_net_connection' into 'master'
lw_ip: Add to sys_arch_protect() a check that the mutex is created before use if not then creates it Closes WIFI-1019 See merge request espressif/esp-idf!7495pull/4797/head
commit
c012011c16
|
@ -423,8 +423,10 @@ sys_thread_new(const char *name, lwip_thread_fn thread, void *arg, int stacksize
|
||||||
void
|
void
|
||||||
sys_init(void)
|
sys_init(void)
|
||||||
{
|
{
|
||||||
if (ERR_OK != sys_mutex_new(&g_lwip_protect_mutex)) {
|
if (!g_lwip_protect_mutex) {
|
||||||
ESP_LOGE(TAG, "sys_init: failed to init lwip protect mutex\n");
|
if (ERR_OK != sys_mutex_new(&g_lwip_protect_mutex)) {
|
||||||
|
ESP_LOGE(TAG, "sys_init: failed to init lwip protect mutex\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create the pthreads key for the per-thread semaphore storage
|
// Create the pthreads key for the per-thread semaphore storage
|
||||||
|
@ -465,6 +467,9 @@ sys_now(void)
|
||||||
sys_prot_t
|
sys_prot_t
|
||||||
sys_arch_protect(void)
|
sys_arch_protect(void)
|
||||||
{
|
{
|
||||||
|
if (unlikely(!g_lwip_protect_mutex)) {
|
||||||
|
sys_mutex_new(&g_lwip_protect_mutex);
|
||||||
|
}
|
||||||
sys_mutex_lock(&g_lwip_protect_mutex);
|
sys_mutex_lock(&g_lwip_protect_mutex);
|
||||||
return (sys_prot_t) 1;
|
return (sys_prot_t) 1;
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue