Changeset 98f2d5c in rtems


Ignore:
Timestamp:
Jun 3, 2014, 6:28:46 AM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, 5, master
Children:
8df1f408
Parents:
5abe5a8
Message:

libblock: Avoid recursive mutex

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libblock/src/bdbuf.c

    r5abe5a8 r98f2d5c  
    183183  RTEMS_BDBUF_FATAL_MTX_ATTR_INIT,
    184184  RTEMS_BDBUF_FATAL_MTX_ATTR_SETPROTO,
    185   RTEMS_BDBUF_FATAL_MTX_ATTR_SETTYPE,
    186185  RTEMS_BDBUF_FATAL_CV_WAIT,
    187186  RTEMS_BDBUF_FATAL_CV_BROADCAST
     
    351350  if (eno != 0)
    352351    rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_MTX_ATTR_SETPROTO);
    353 
    354   eno = pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE);
    355   if (eno != 0)
    356     rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_MTX_ATTR_SETTYPE);
    357352
    358353  eno = pthread_mutex_init (lock, &attr);
     
    30943089}
    30953090
    3096 void
    3097 rtems_bdbuf_purge_dev (rtems_disk_device *dd)
     3091static void
     3092rtems_bdbuf_do_purge_dev (rtems_disk_device *dd)
    30983093{
    30993094  rtems_chain_control purge_list;
    31003095
    31013096  rtems_chain_initialize_empty (&purge_list);
    3102   rtems_bdbuf_lock_cache ();
    31033097  rtems_bdbuf_read_ahead_reset (dd);
    31043098  rtems_bdbuf_gather_for_purge (&purge_list, dd);
    31053099  rtems_bdbuf_purge_list (&purge_list);
     3100}
     3101
     3102void
     3103rtems_bdbuf_purge_dev (rtems_disk_device *dd)
     3104{
     3105  rtems_bdbuf_lock_cache ();
     3106  rtems_bdbuf_do_purge_dev (dd);
    31063107  rtems_bdbuf_unlock_cache ();
    31073108}
     
    31473148      dd->bds_per_group = bds_per_group;
    31483149
    3149       rtems_bdbuf_purge_dev (dd);
     3150      rtems_bdbuf_do_purge_dev (dd);
    31503151    }
    31513152    else
Note: See TracChangeset for help on using the changeset viewer.