From 81a3ec250e2a747e2bc8fbd52a1bd865c57d685e Mon Sep 17 00:00:00 2001 From: zhangyuan7 Date: Tue, 19 Mar 2019 09:54:22 -0600 Subject: [PATCH] net/local: Fixed deadlock issue by replacing nxsem_wait() with net_lockedwait() so that we do not wait with the network locked. --- net/local/local_accept.c | 2 +- net/local/local_connect.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net/local/local_accept.c b/net/local/local_accept.c index e11d6872ec..151491da64 100644 --- a/net/local/local_accept.c +++ b/net/local/local_accept.c @@ -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); diff --git a/net/local/local_connect.c b/net/local/local_connect.c index b254dae62a..e452f9b6f6 100644 --- a/net/local/local_connect.c +++ b/net/local/local_connect.c @@ -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.