net/local: Fixed deadlock issue by replacing nxsem_wait() with net_lockedwait() so that we do not wait with the network locked.

This commit is contained in:
zhangyuan7 2019-03-19 09:54:22 -06:00 committed by Gregory Nutt
parent 656c20fd4a
commit 81a3ec250e
2 changed files with 2 additions and 2 deletions

View File

@ -70,7 +70,7 @@ static int local_waitlisten(FAR struct local_conn_s *server)
{
/* No.. wait for a connection or a signal */
ret = nxsem_wait(&server->lc_waitsem);
ret = net_lockedwait(&server->lc_waitsem);
if (ret < 0)
{
DEBUGASSERT(ret == -EINTR || ret == -ECANCELED);

View File

@ -97,7 +97,7 @@ static inline void _local_semtake(sem_t *sem)
{
/* Take the semaphore (perhaps waiting) */
ret = nxsem_wait(sem);
ret = net_lockedwait(sem);
/* The only case that an error should occur here is if the wait was
* awakened by a signal.