Changeset ec84273d in rtems for testsuites/support


Ignore:
Timestamp:
May 27, 2015, 9:43:44 AM (5 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
9d0913d1
Parents:
ffe14b26
git-author:
Sebastian Huber <sebastian.huber@…> (05/27/15 09:43:44)
git-committer:
Sebastian Huber <sebastian.huber@…> (05/27/15 10:24:24)
Message:

score: Replace _API_Mutex_Is_locked()

Replace _API_Mutex_Is_locked() with _API_Mutex_Is_owner().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • testsuites/support/include/tmacros.h

    rffe14b26 rec84273d  
    7171
    7272/*
    73  *  Check that that the allocator mutex is not locked. It should never
    74  *  be locked unless inside a service which is allocating a resource.
    75  *
    76  *  This test is only valid when in a non-SMP system.  In an SMP system
    77  *  another cpu may be allocating a resource while we are computing.
    78  */
    79 #if defined SMPTEST
    80   #define check_if_allocator_mutex_is_unlocked()
    81 #else
    82   #include <rtems/score/apimutex.h>
    83   #define check_if_allocator_mutex_is_unlocked() \
    84     do { \
    85       if ( _RTEMS_Check_if_allocator_is_locked() ) { \
    86         printk( \
    87           "\nRTEMS Allocator Mutex is locked and should not be.\n" \
    88           "Detected at %s:%d\n", \
    89           __FILE__, \
    90           __LINE__ \
    91         ); \
    92         FLUSH_OUTPUT(); \
    93         rtems_test_exit( 1 ); \
    94       } \
    95     } while ( 0 )
    96 #endif
     73 *  Check that that the allocator mutex is not owned by the executing thread.
     74 */
     75#include <rtems/score/apimutex.h>
     76#define check_if_allocator_mutex_is_not_owned() \
     77  do { \
     78    if ( _RTEMS_Allocator_is_owner() ) { \
     79      printk( \
     80        "\nRTEMS Allocator Mutex is owned by executing thread " \
     81          "and should not be.\n" \
     82        "Detected at %s:%d\n", \
     83        __FILE__, \
     84        __LINE__ \
     85      ); \
     86      FLUSH_OUTPUT(); \
     87      rtems_test_exit( 1 ); \
     88    } \
     89  } while ( 0 )
    9790
    9891/*
     
    122115  do { \
    123116    check_dispatch_disable_level( _level ); \
    124     check_if_allocator_mutex_is_unlocked(); \
     117    check_if_allocator_mutex_is_not_owned(); \
    125118    fatal_directive_check_status_only( _stat, _desired, _msg ); \
    126119  } while ( 0 )
     
    140133    long statx = _stat; \
    141134    check_dispatch_disable_level( 0 ); \
    142     check_if_allocator_mutex_is_unlocked(); \
     135    check_if_allocator_mutex_is_not_owned(); \
    143136    printf( "\n%s FAILED -- expected (%d - %s) got (%ld %d - %s)\n", \
    144137            (_msg), _desired, strerror(_desired), \
     
    154147  do { \
    155148    check_dispatch_disable_level( _level ); \
    156     check_if_allocator_mutex_is_unlocked(); \
     149    check_if_allocator_mutex_is_not_owned(); \
    157150    if ( (_stat) != (_desired) ) { \
    158151      printf( "\n%s FAILED -- expected (%d - %s) got (%d - %s)\n", \
Note: See TracChangeset for help on using the changeset viewer.