Data Structures | |
| struct | CORE_spinlock_Attributes |
| struct | CORE_spinlock_Control |
Defines | |
| #define | CORE_SPINLOCK_STATUS_LAST CORE_SPINLOCK_NOT_LOCKED |
| #define | CORE_SPINLOCK_UNLOCKED 0 |
| #define | CORE_SPINLOCK_LOCKED 1 |
Enumerations | |
| enum | CORE_spinlock_Status { CORE_SPINLOCK_SUCCESSFUL, CORE_SPINLOCK_HOLDER_RELOCKING, CORE_SPINLOCK_NOT_HOLDER, CORE_SPINLOCK_TIMEOUT, CORE_SPINLOCK_IS_BUSY, CORE_SPINLOCK_UNAVAILABLE, CORE_SPINLOCK_NOT_LOCKED } |
Functions | |
| void | _CORE_spinlock_Initialize (CORE_spinlock_Control *the_spinlock, CORE_spinlock_Attributes *the_spinlock_attributes) |
| CORE_spinlock_Status | _CORE_spinlock_Wait (CORE_spinlock_Control *the_spinlock, boolean wait, Watchdog_Interval timeout) |
| CORE_spinlock_Status | _CORE_spinlock_Release (CORE_spinlock_Control *the_spinlock) |
| RTEMS_INLINE_ROUTINE boolean | _CORE_spinlock_Is_busy (CORE_spinlock_Control *the_spinlock) |
| #define CORE_SPINLOCK_LOCKED 1 |
This indicates the lock is unavailable.
| #define CORE_SPINLOCK_STATUS_LAST CORE_SPINLOCK_NOT_LOCKED |
This is a shorthand for the last status code.
| #define CORE_SPINLOCK_UNLOCKED 0 |
This indicates the lock is available.
| enum CORE_spinlock_Status |
Core Spinlock handler return statuses.
| void _CORE_spinlock_Initialize | ( | CORE_spinlock_Control * | the_spinlock, | |
| CORE_spinlock_Attributes * | the_spinlock_attributes | |||
| ) |
This routine initializes the spinlock based on the parameters passed.
| [in] | the_spinlock | is the spinlock to initialize |
| [in] | the_spinlock_attributes | define the behavior of this instance |
| RTEMS_INLINE_ROUTINE boolean _CORE_spinlock_Is_busy | ( | CORE_spinlock_Control * | the_spinlock | ) |
This method is used to determine if the spinlock is available or not.
| [in] | the_spinlock | will be checked |
References CORE_spinlock_Control::users.
| CORE_spinlock_Status _CORE_spinlock_Release | ( | CORE_spinlock_Control * | the_spinlock | ) |
This routine manually releases the spinlock. All of the threads waiting for the spinlock will be readied.
| [in] | the_spinlock | is the spinlock to surrender |
| CORE_spinlock_Status _CORE_spinlock_Wait | ( | CORE_spinlock_Control * | the_spinlock, | |
| boolean | wait, | |||
| Watchdog_Interval | timeout | |||
| ) |
This routine wait for the spinlock to be released. If the spinlock is set to automatic and this is the appropriate thread, then it returns immediately. Otherwise, the calling thread is blocked until the spinlock is released.
| [in] | the_spinlock | is the spinlock to wait for |
| [in] | wait | is true if willing to wait |
| [in] | timeout | is the maximum number of ticks to spin (0 is forever) |
1.5.6