Changeset 41b37e00 in rtems


Ignore:
Timestamp:
Mar 27, 2015, 1:08:10 PM (5 years ago)
Author:
Martin Galvan <martin.galvan@…>
Branches:
4.11, master
Children:
c5d86ec0
Parents:
b8cdc38b
git-author:
Martin Galvan <martin.galvan@…> (03/27/15 13:08:10)
git-committer:
Sebastian Huber <sebastian.huber@…> (04/17/15 09:03:02)
Message:

score: Improve assert

While cpu_self->thread_dispatch_disable_level shouldn't ever be zero, it
would be better to check it before doing the decrement.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/src/threaddispatchdisablelevel.c

    rb8cdc38b r41b37e00  
    108108  cpu_self = _Per_CPU_Get();
    109109  disable_level = cpu_self->thread_dispatch_disable_level;
     110  _Assert( disable_level > 0);
    110111  --disable_level;
    111112  cpu_self->thread_dispatch_disable_level = disable_level;
    112113
    113114  _Giant_Do_release( cpu_self );
    114   _Assert( disable_level != 0 || _Giant.owner_cpu != cpu_self );
     115  _Assert(
     116    ( disable_level == 0 && _Giant.owner_cpu != cpu_self )
     117      || ( disable_level != 0 && _Giant.owner_cpu == cpu_self )
     118  );
    115119
    116120  _Profiling_Thread_dispatch_enable( cpu_self, disable_level );
Note: See TracChangeset for help on using the changeset viewer.