mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-03-27 05:39:57 +00:00
committed by
Kinsey Moore
parent
a0a80f08ca
commit
f6933b9c6f
@@ -156,10 +156,15 @@ void rtems_libio_free_iop(
|
||||
)
|
||||
{
|
||||
size_t zero;
|
||||
unsigned int flags;
|
||||
|
||||
/*
|
||||
* Use atomic test and set so the contents of the if statement
|
||||
* can only be run once. Therefore only added to the free list once.
|
||||
*/
|
||||
flags = rtems_libio_iop_flags_set( iop, LIBIO_FLAGS_FREE );
|
||||
if ( ( flags & LIBIO_FLAGS_FREE ) == 0 ) {
|
||||
rtems_libio_lock();
|
||||
|
||||
if ( !rtems_libio_iop_is_free( iop ) ) {
|
||||
/*
|
||||
* Clear the flags. All references should have been dropped.
|
||||
*/
|
||||
@@ -176,9 +181,8 @@ void rtems_libio_free_iop(
|
||||
*/
|
||||
*rtems_libio_iop_free_tail = iop;
|
||||
rtems_libio_iop_free_tail = &iop->data1;
|
||||
}
|
||||
|
||||
rtems_libio_unlock();
|
||||
}
|
||||
}
|
||||
|
||||
int rtems_libio_count_open_iops(
|
||||
|
||||
Reference in New Issue
Block a user