drivers: Disable priority inheritance on all semaphores used for signaling

This commit is contained in:
Gregory Nutt
2016-11-03 11:00:47 -06:00
parent bdde5720ca
commit 4fcbe8e410
20 changed files with 184 additions and 19 deletions
+11 -4
View File
@@ -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;