mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 00:14:22 +08:00
drivers: Disable priority inheritance on all semaphores used for signaling
This commit is contained in:
+3
-1
@@ -55,8 +55,9 @@
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/irq.h>
|
||||
#include <nuttx/net/net.h>
|
||||
#include <nuttx/clock.h>
|
||||
#include <nuttx/semaphore.h>
|
||||
#include <nuttx/net/net.h>
|
||||
#include <nuttx/net/netdev.h>
|
||||
#include <nuttx/net/ip.h>
|
||||
#include <nuttx/net/slip.h>
|
||||
@@ -965,6 +966,7 @@ int slip_initialize(int intf, FAR const char *devname)
|
||||
/* Initialize the wait semaphore */
|
||||
|
||||
sem_init(&priv->waitsem, 0, 0);
|
||||
sem_setprotocol(&priv->waitsem, SEM_PRIO_NONE);
|
||||
|
||||
/* Put the interface in the down state. This usually amounts to resetting
|
||||
* the device and/or calling slip_ifdown().
|
||||
|
||||
+7
-1
@@ -884,11 +884,17 @@ static int tun_dev_init(FAR struct tun_device_s *priv, FAR struct file *filep,
|
||||
#endif
|
||||
priv->dev.d_private = (FAR void *)priv; /* Used to recover private state from dev */
|
||||
|
||||
/* Initialize the wait semaphore */
|
||||
/* Initialize the mutual exlcusion and wait semaphore */
|
||||
|
||||
sem_init(&priv->waitsem, 0, 1);
|
||||
sem_init(&priv->read_wait_sem, 0, 0);
|
||||
|
||||
/* The wait semaphore is used for signaling and, hence, should not have
|
||||
* priority inheritance enabled.
|
||||
*/
|
||||
|
||||
sem_setprotocol(&priv->read_wait_sem, SEM_PRIO_NONE);
|
||||
|
||||
/* Create a watchdog for timing polling for and timing of transmisstions */
|
||||
|
||||
priv->txpoll = wd_create(); /* Create periodic poll timer */
|
||||
|
||||
Reference in New Issue
Block a user