mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 16:50:55 +08:00
drivers: Disable priority inheritance on all semaphores used for signaling
This commit is contained in:
+11
-4
@@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* drivers/syslog/ramlog.c
|
||||
*
|
||||
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -53,10 +53,10 @@
|
||||
#include <assert.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/fs/fs.h>
|
||||
#include <nuttx/kmalloc.h>
|
||||
#include <nuttx/fs/fs.h>
|
||||
#include <nuttx/arch.h>
|
||||
#include <nuttx/kmalloc.h>
|
||||
#include <nuttx/semaphore.h>
|
||||
#include <nuttx/fs/fs.h>
|
||||
#include <nuttx/syslog/ramlog.h>
|
||||
|
||||
#include <nuttx/irq.h>
|
||||
@@ -694,7 +694,14 @@ int ramlog_register(FAR const char *devpath, FAR char *buffer, size_t buflen)
|
||||
sem_init(&priv->rl_exclsem, 0, 1);
|
||||
#ifndef CONFIG_RAMLOG_NONBLOCKING
|
||||
sem_init(&priv->rl_waitsem, 0, 0);
|
||||
|
||||
/* The rl_waitsem semaphore is used for signaling and, hence, should
|
||||
* not have priority inheritance enabled.
|
||||
*/
|
||||
|
||||
sem_setprotocol(&priv->rl_waitsem, SEM_PRIO_NONE);
|
||||
#endif
|
||||
|
||||
priv->rl_bufsize = buflen;
|
||||
priv->rl_buffer = buffer;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user