Ticket #2026: 0001-PR-2026-filesystem-Fix-semaphore-attributes.patch

File 0001-PR-2026-filesystem-Fix-semaphore-attributes.patch, 1.4 KB (added by Sebastian Huber, on 02/21/12 at 11:00:15)

Patch.

  • cpukit/libfs/src/rfs/rtems-rfs-mutex.c

    From cf1c3953decff9dae33c6c13e7869e0e72f5c087 Mon Sep 17 00:00:00 2001
    From: Sebastian Huber <sebastian.huber@embedded-brains.de>
    Date: Tue, 21 Feb 2012 12:56:51 +0100
    Subject: [PATCH] PR 2026/filesystem - Fix semaphore attributes
    
    Semaphores of type RTEMS_SIMPLE_BINARY_SEMAPHORE are not suitable for a
    mutex.  Use RTEMS_BINARY_SEMAPHORE with RTEMS_INHERIT_PRIORITY instead.
    ---
     cpukit/libfs/src/rfs/rtems-rfs-mutex.c |    9 ++-------
     1 files changed, 2 insertions(+), 7 deletions(-)
    
    diff --git a/cpukit/libfs/src/rfs/rtems-rfs-mutex.c b/cpukit/libfs/src/rfs/rtems-rfs-mutex.c
    index 04d700a..f35350f 100644
    a b  
    2424#if __rtems__
    2525/**
    2626 * RTEMS_RFS Mutex Attributes
    27  *
    28  * @warning Do not configure as inherit priority. If a driver is in the driver
    29  *          initialisation table this locked semaphore will have the IDLE task
    30  *          as the holder and a blocking task will raise the priority of the
    31  *          IDLE task which can cause unsual side effects like not work.
    3227 */
    3328#define RTEMS_RFS_MUTEX_ATTRIBS \
    34   (RTEMS_PRIORITY | RTEMS_SIMPLE_BINARY_SEMAPHORE | \
    35    RTEMS_NO_INHERIT_PRIORITY | RTEMS_NO_PRIORITY_CEILING | RTEMS_LOCAL)
     29  (RTEMS_PRIORITY | RTEMS_BINARY_SEMAPHORE | \
     30   RTEMS_INHERIT_PRIORITY | RTEMS_NO_PRIORITY_CEILING | RTEMS_LOCAL)
    3631#endif
    3732
    3833int