nuttx/net: Replace irqsave() with enter_critical_section(); replace irqrestore() with leave_critical_section()

This commit is contained in:
Gregory Nutt
2016-02-14 08:38:44 -06:00
parent e6bd3544f6
commit aa3e778dc6
8 changed files with 44 additions and 55 deletions
+4 -3
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* net/utils/net_lock.c
*
* Copyright (C) 2011-2012, 2014-2015 Gregory Nutt. All rights reserved.
* Copyright (C) 2011-2012, 2014-2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -45,6 +45,7 @@
#include <errno.h>
#include <debug.h>
#include <nuttx/irq.h>
#include <nuttx/arch.h>
#include <nuttx/net/net.h>
@@ -197,7 +198,7 @@ int net_timedwait(sem_t *sem, FAR const struct timespec *abstime)
irqstate_t flags;
int ret;
flags = irqsave(); /* No interrupts */
flags = enter_critical_section(); /* No interrupts */
sched_lock(); /* No context switches */
if (g_holder == me)
{
@@ -235,7 +236,7 @@ int net_timedwait(sem_t *sem, FAR const struct timespec *abstime)
}
sched_unlock();
irqrestore(flags);
leave_critical_section(flags);
return ret;
}