Changeset c07c85f in rtems


Ignore:
Timestamp:
May 4, 2015, 7:24:10 AM (4 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
2b0bbc4
Parents:
5f7f469
git-author:
Sebastian Huber <sebastian.huber@…> (05/04/15 07:24:10)
git-committer:
Sebastian Huber <sebastian.huber@…> (05/19/15 10:00:44)
Message:

Filesystem: Use lock for deferred release

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libcsupport/src/sup_fs_location.c

    r5f7f469 rc07c85f  
    77
    88/*
    9  * Copyright (c) 2012 embedded brains GmbH.  All rights reserved.
     9 * Copyright (c) 2012-2015 embedded brains GmbH.  All rights reserved.
    1010 *
    1111 *  embedded brains GmbH
    12  *  Obere Lagerstr. 30
     12 *  Dornierstr. 4
    1313 *  82178 Puchheim
    1414 *  Germany
     
    3131rtems_interrupt_lock rtems_filesystem_mt_entry_lock_control =
    3232  RTEMS_INTERRUPT_LOCK_INITIALIZER("mount table entry");
     33
     34RTEMS_INTERRUPT_LOCK_DEFINE(
     35  static,
     36  deferred_release_lock,
     37  "Filesystem Deferred Release"
     38)
    3339
    3440static rtems_filesystem_global_location_t *deferred_released_global_locations;
     
    135141
    136142  do {
     143    rtems_interrupt_lock_context lock_context;
    137144    int count = 0;
    138145
    139     _Thread_Disable_dispatch();
     146    rtems_interrupt_lock_acquire(&deferred_release_lock, &lock_context);
    140147    current = deferred_released_global_locations;
    141148    if (current != NULL) {
     
    145152      current->deferred_released_count = 0;
    146153    }
    147     _Thread_Enable_dispatch();
     154    rtems_interrupt_lock_release(&deferred_release_lock, &lock_context);
    148155
    149156    if (current != NULL) {
     
    183190    release_with_count(global_loc, 1);
    184191  } else {
     192    rtems_interrupt_lock_context lock_context;
     193
     194    rtems_interrupt_lock_acquire(&deferred_release_lock, &lock_context);
     195
    185196    if (global_loc->deferred_released_count == 0) {
    186197      rtems_filesystem_global_location_t *head =
     
    193204      ++global_loc->deferred_released_count;
    194205    }
     206
     207    rtems_interrupt_lock_release(&deferred_release_lock, &lock_context);
    195208  }
    196209}
Note: See TracChangeset for help on using the changeset viewer.