Changeset 271690e in rtems


Ignore:
Timestamp:
Oct 11, 2016, 12:42:55 PM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
4745650
Parents:
282de10
git-author:
Sebastian Huber <sebastian.huber@…> (10/11/16 12:42:55)
git-committer:
Sebastian Huber <sebastian.huber@…> (10/11/16 12:44:47)
Message:

score: Enhance _SMP_barrier_Wait()

Indicate which processor released the barrier. Similar to
pthread_barrier_wait().

Location:
cpukit/score
Files:
2 edited

Legend:

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

    r282de10 r271690e  
    107107 * @param[in, out] state The SMP barrier per-thread state.
    108108 * @param[in] count The thread count bound to rendezvous.
     109 *
     110 * @retval true This processor performed the barrier release.
     111 * @retval false Otherwise.
    109112 */
    110 void _SMP_barrier_Wait(
     113bool _SMP_barrier_Wait(
    111114  SMP_barrier_Control *control,
    112115  SMP_barrier_State *state,
  • cpukit/score/src/smpbarrierwait.c

    r282de10 r271690e  
    1919#include <rtems/score/smpbarrier.h>
    2020
    21 void _SMP_barrier_Wait(
     21bool _SMP_barrier_Wait(
    2222  SMP_barrier_Control *control,
    2323  SMP_barrier_State *state,
     
    2727  unsigned int sense = ~state->sense;
    2828  unsigned int previous_value;
     29  bool performed_release;
    2930
    3031  state->sense = sense;
     
    3940    _Atomic_Store_uint( &control->value, 0U, ATOMIC_ORDER_RELAXED );
    4041    _Atomic_Store_uint( &control->sense, sense, ATOMIC_ORDER_RELEASE );
     42    performed_release = true;
    4143  } else {
    4244    while (
     
    4547      /* Wait */
    4648    }
     49
     50    performed_release = false;
    4751  }
     52
     53  return performed_release;
    4854}
Note: See TracChangeset for help on using the changeset viewer.