Changeset 610909f in rtems


Ignore:
Timestamp:
Nov 11, 2015, 11:05:22 AM (4 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
b84a51c
Parents:
5c7bfcf
git-author:
Sebastian Huber <sebastian.huber@…> (11/11/15 11:05:22)
git-committer:
Sebastian Huber <sebastian.huber@…> (11/12/15 07:21:45)
Message:

irq-server: Fix race condition on SMP systems

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/shared/src/irq-server.c

    r5c7bfcf r610909f  
    5858static void bsp_interrupt_server_trigger(void *arg)
    5959{
     60  rtems_interrupt_lock_context lock_context;
    6061  bsp_interrupt_server_entry *e = arg;
    6162
    6263  bsp_interrupt_vector_disable(e->vector);
    6364
     65  rtems_interrupt_lock_acquire(&bsp_interrupt_server_lock, &lock_context);
     66
    6467  if (rtems_chain_is_node_off_chain(&e->node)) {
    65     rtems_interrupt_lock_context lock_context;
    66 
    67     rtems_interrupt_lock_acquire(&bsp_interrupt_server_lock, &lock_context);
    6868    rtems_chain_append_unprotected(&bsp_interrupt_server_chain, &e->node);
    69     rtems_interrupt_lock_release(&bsp_interrupt_server_lock, &lock_context);
    7069  } else {
    7170    ++bsp_interrupt_server_errors;
    7271  }
     72
     73  rtems_interrupt_lock_release(&bsp_interrupt_server_lock, &lock_context);
    7374
    7475  rtems_event_system_send(bsp_interrupt_server_id, RTEMS_EVENT_SYSTEM_SERVER);
Note: See TracChangeset for help on using the changeset viewer.