Skip to content

Commit

Permalink
net: remove [enter|leave]_critical_section and sched_[un]lock
Browse files Browse the repository at this point in the history
Signed-off-by: hujun5 <hujun5@xiaomi.com>
  • Loading branch information
hujun260 committed Aug 10, 2023
1 parent b705103 commit 105c599
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
2 changes: 0 additions & 2 deletions net/netlink/netlink_sockif.c
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,6 @@ static void netlink_response_available(FAR void *arg)
* condition?
*/

sched_lock();
net_lock();

if (conn->fds != NULL)
Expand All @@ -443,7 +442,6 @@ static void netlink_response_available(FAR void *arg)
conn->fds = NULL;

net_unlock();
sched_unlock();
}

/****************************************************************************
Expand Down
12 changes: 0 additions & 12 deletions net/utils/net_lock.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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.
*/
Expand All @@ -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;
}

Expand Down

0 comments on commit 105c599

Please sign in to comment.