Changeset 47d2464 in rtems


Ignore:
Timestamp:
Oct 31, 2016, 3:23:52 PM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
9599b468
Parents:
9e7fa07
git-author:
Sebastian Huber <sebastian.huber@…> (10/31/16 15:23:52)
git-committer:
Sebastian Huber <sebastian.huber@…> (11/03/16 10:23:30)
Message:

score: Conditionally enable thread resource count

Maintain the thread resource count only in debug configurations. This
is a performance optimization for non-debug configurations.

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/include/rtems/score/thread.h

    r9e7fa07 r47d2464  
    8282#if defined(RTEMS_POSIX_API)
    8383  #define RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API
     84#endif
     85
     86#if defined(RTEMS_DEBUG)
     87#define RTEMS_SCORE_THREAD_ENABLE_RESOURCE_COUNT
    8488#endif
    8589
     
    493497  Priority_Node            Real_priority;
    494498
     499#if defined(RTEMS_SCORE_THREAD_ENABLE_RESOURCE_COUNT)
    495500  /** This field is the number of mutexes currently held by this proxy. */
    496501  uint32_t                 resource_count;
     502#endif
    497503
    498504  /**
     
    717723  Priority_Node            Real_priority;
    718724
     725#if defined(RTEMS_SCORE_THREAD_ENABLE_RESOURCE_COUNT)
    719726  /** This field is the number of mutexes currently held by this thread. */
    720727  uint32_t                 resource_count;
     728#endif
    721729
    722730  /**
  • cpukit/score/include/rtems/score/threadimpl.h

    r9e7fa07 r47d2464  
    978978)
    979979{
     980#if defined(RTEMS_SCORE_THREAD_ENABLE_RESOURCE_COUNT)
    980981  ++the_thread->resource_count;
     982#else
     983  (void) the_thread;
     984#endif
    981985}
    982986
     
    985989)
    986990{
     991#if defined(RTEMS_SCORE_THREAD_ENABLE_RESOURCE_COUNT)
    987992  --the_thread->resource_count;
    988 }
    989 
     993#else
     994  (void) the_thread;
     995#endif
     996}
     997
     998#if defined(RTEMS_SCORE_THREAD_ENABLE_RESOURCE_COUNT)
    990999/**
    9911000 * @brief Returns true if the thread owns resources, and false otherwise.
     
    10021011  return the_thread->resource_count != 0;
    10031012}
     1013#endif
    10041014
    10051015#if defined(RTEMS_SMP)
  • cpukit/score/src/thread.c

    r9e7fa07 r47d2464  
    3434THREAD_OFFSET_ASSERT( current_state );
    3535THREAD_OFFSET_ASSERT( Real_priority );
     36#if defined(RTEMS_SCORE_THREAD_ENABLE_RESOURCE_COUNT)
    3637THREAD_OFFSET_ASSERT( resource_count );
     38#endif
    3739THREAD_OFFSET_ASSERT( Scheduler );
    3840THREAD_OFFSET_ASSERT( Wait );
  • cpukit/score/src/threadrestart.c

    r9e7fa07 r47d2464  
    134134static void _Thread_Make_zombie( Thread_Control *the_thread )
    135135{
     136#if defined(RTEMS_SCORE_THREAD_ENABLE_RESOURCE_COUNT)
    136137  if ( _Thread_Owns_resources( the_thread ) ) {
    137138    _Terminate(
     
    141142    );
    142143  }
     144#endif
    143145
    144146  _Objects_Close(
  • testsuites/sptests/spfatal28/testcase.h

    r9e7fa07 r47d2464  
    2323void force_error()
    2424{
     25#if defined(RTEMS_SCORE_THREAD_ENABLE_RESOURCE_COUNT)
    2526  rtems_status_code sc;
    2627  rtems_id id;
     
    3738  sc = rtems_task_delete(RTEMS_SELF);
    3839  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
     40#else
     41  _Terminate( INTERNAL_ERROR_CORE, false, INTERNAL_ERROR_RESOURCE_IN_USE );
     42#endif
    3943}
Note: See TracChangeset for help on using the changeset viewer.