Changeset 64ed0bb3 in rtems


Ignore:
Timestamp:
Jul 14, 2016, 12:55:49 PM (4 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
5, master
Children:
992494e
Parents:
059529e
git-author:
Sebastian Huber <sebastian.huber@…> (07/14/16 12:55:49)
git-committer:
Sebastian Huber <sebastian.huber@…> (07/22/16 09:24:53)
Message:

score: Assert proper seqlock writer state

Helps to detect invalid concurrent writes.

File:
1 edited

Legend:

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

    r059529e r64ed0bb3  
    2222#if defined(RTEMS_SMP)
    2323
     24#include <rtems/score/assert.h>
    2425#include <rtems/score/atomic.h>
    2526
     
    103104
    104105  seq = _Atomic_Load_uint( &lock->sequence, ATOMIC_ORDER_RELAXED );
     106  _Assert( seq % 2 == 0 );
     107
    105108  _Atomic_Store_uint( &lock->sequence, seq + 1, ATOMIC_ORDER_RELAXED );
    106109
Note: See TracChangeset for help on using the changeset viewer.