net: remove [enter|leave]_critical_section and sched_[un]lock
Signed-off-by: hujun5 <hujun5@xiaomi.com>
This commit is contained in:
parent
6b4e5c0d15
commit
34dcd1c50a
@ -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();
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user