fs: disable priority inheritance on all signaling semaphores
authorHeesub Shin <heesub.shin@samsung.com>
Thu, 6 Apr 2017 01:56:27 +0000 (10:56 +0900)
committerHeesub Shin <heesub.shin@samsung.com>
Tue, 18 Apr 2017 03:02:11 +0000 (12:02 +0900)
Disable priority inheritance on all semaphores used for signaling.

Change-Id: I2d032767bff07012d7724a2228705dc125d42fd8
Signed-off-by: Gregory Nutt <gnutt@nuttx.org>
[Shin: backported dbbe46a2 from NuttX]
Signed-off-by: Heesub Shin <heesub.shin@samsung.com>
os/fs/vfs/fs_poll.c

index d4740a7..dd4a903 100644 (file)
@@ -66,6 +66,7 @@
 #include <tinyara/sched.h>
 #include <tinyara/clock.h>
 #include <tinyara/cancelpt.h>
+#include <tinyara/semaphore.h>
 #include <tinyara/fs/fs.h>
 
 #ifdef CONFIG_NET_LWIP
@@ -321,7 +322,13 @@ int poll(FAR struct pollfd *fds, nfds_t nfds, int timeout)
        /* poll() is a cancellation point */
        (void)enter_cancellation_point();
 
+       /*
+        * This semaphore is used for signaling and, hence, should not have
+        * priority inheritance enabled.
+        */
        sem_init(&sem, 0, 0);
+       sem_setprotocol(&sem, SEM_PRIO_NONE);
+
        ret = poll_setup(fds, nfds, &sem);
        if (ret >= 0) {
                if (timeout == 0) {