From 34dcd1c50a186c7e5a5f75933c0a05ccc5577406 Mon Sep 17 00:00:00 2001 From: hujun5 Date: Thu, 3 Aug 2023 08:25:46 +0800 Subject: [PATCH] net: remove [enter|leave]_critical_section and sched_[un]lock Signed-off-by: hujun5 --- net/netlink/netlink_sockif.c | 2 -- net/utils/net_lock.c | 12 ------------ 2 files changed, 14 deletions(-) diff --git a/net/netlink/netlink_sockif.c b/net/netlink/netlink_sockif.c index 5c9ac9887a..b42805ae21 100644 --- a/net/netlink/netlink_sockif.c +++ b/net/netlink/netlink_sockif.c @@ -424,7 +424,6 @@ static void netlink_response_available(FAR void *arg) * condition? */ - sched_lock(); net_lock(); if (conn->fds != NULL) @@ -443,7 +442,6 @@ static void netlink_response_available(FAR void *arg) conn->fds = NULL; net_unlock(); - sched_unlock(); } /**************************************************************************** diff --git a/net/utils/net_lock.c b/net/utils/net_lock.c index 8b499b4a84..0196dd9b15 100644 --- a/net/utils/net_lock.c +++ b/net/utils/net_lock.c @@ -64,13 +64,9 @@ static int _net_timedwait(sem_t *sem, bool interruptible, unsigned int timeout) { unsigned int count; - irqstate_t flags; int blresult; int ret; - flags = enter_critical_section(); /* No interrupts */ - sched_lock(); /* No context switches */ - /* Release the network lock, remembering my count. net_breaklock will * return a negated value if the caller does not hold the network lock. */ @@ -113,8 +109,6 @@ _net_timedwait(sem_t *sem, bool interruptible, unsigned int timeout) net_restorelock(count); } - sched_unlock(); - leave_critical_section(flags); return ret; } @@ -267,13 +261,9 @@ int net_sem_timedwait(sem_t *sem, unsigned int timeout) int net_mutex_timedlock(mutex_t *mutex, unsigned int timeout) { unsigned int count; - irqstate_t flags; int blresult; int ret; - flags = enter_critical_section(); /* No interrupts */ - sched_lock(); /* No context switches */ - /* Release the network lock, remembering my count. net_breaklock will * return a negated value if the caller does not hold the network lock. */ @@ -300,8 +290,6 @@ int net_mutex_timedlock(mutex_t *mutex, unsigned int timeout) net_restorelock(count); } - sched_unlock(); - leave_critical_section(flags); return ret; }