Changeset 35453000 in rtems for cpukit/score/src/smplock.c


Ignore:
Timestamp:
Oct 17, 2011, 6:51:44 PM (10 years ago)
Author:
Jennifer Averett <Jennifer.Averett@…>
Branches:
4.11, 5, master
Children:
c0b35f9
Parents:
d63f1c9
Message:

2011-10-17 Daniel Hellstrom <daniel@…>

PR 1935/cpukit

  • score/include/rtems/score/smplock.h, score/src/smplock.c: SMP nested count variable was being overritten when nested lock was taken more than once.
File:
1 edited

Legend:

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

    rd63f1c9 r35453000  
    115115)
    116116{
     117  lock->lock = 0;
    117118  lock->count = 0;
    118119  lock->cpu_id = -1;
     
    144145    lock->cpu_id = -1;
    145146    debug_logit( 'U', lock );
     147    lock->count  = 0;
    146148    RTEMS_COMPILER_MEMORY_BARRIER();
    147     lock->count = 0;
     149    lock->lock = 0;
    148150  } else {
    149151    debug_logit( 'u', lock );
     
    175177  while (1) {
    176178    RTEMS_COMPILER_MEMORY_BARRIER();
    177     SMP_CPU_SWAP( &lock->count, value, previous );
     179    SMP_CPU_SWAP( &lock->lock, value, previous );
    178180    RTEMS_COMPILER_MEMORY_BARRIER();
    179181    if ( previous == 0 ) {
     
    191193
    192194  lock->cpu_id = cpu_id;
     195  lock->count = 1;
    193196  debug_logit( 'L', lock );
    194197
Note: See TracChangeset for help on using the changeset viewer.