Difference between revisions of "Unit Threads"
Line 4,609: | Line 4,609: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Called only during system startup | | Called only during system startup | ||
|- | |- | ||
Line 4,621: | Line 4,621: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Called only during system startup | | Called only during system startup | ||
|- | |- | ||
Line 4,633: | Line 4,633: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Called only during system startup | | Called only during system startup | ||
|- | |- | ||
Line 4,645: | Line 4,645: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Called only during system startup | | Called only during system startup | ||
|- | |- | ||
Line 4,657: | Line 4,657: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Called only during system startup | | Called only during system startup | ||
|- | |- | ||
Line 4,669: | Line 4,669: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Called only during system startup | | Called only during system startup | ||
|- | |- | ||
Line 4,681: | Line 4,681: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Called only during system startup | | Called only during system startup | ||
|- | |- | ||
Line 4,693: | Line 4,693: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| The Secondary Boot procedure should have already cleared L1 cache, enabled FPU, MMU, Vectors and PageTables before calling this function. The thread Id of the IRQ or FIQ should also have been loaded into the appropriate registers. Note: Called only during system startup. | | The Secondary Boot procedure should have already cleared L1 cache, enabled FPU, MMU, Vectors and PageTables before calling this function. The thread Id of the IRQ or FIQ should also have been loaded into the appropriate registers. Note: Called only during system startup. | ||
|- | |- | ||
Line 4,705: | Line 4,705: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Not intended to be called directly by applications | | Not intended to be called directly by applications | ||
|- | |- | ||
Line 4,717: | Line 4,717: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Not intended to be called directly by applications | | Not intended to be called directly by applications | ||
|- | |- | ||
Line 4,729: | Line 4,729: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Not intended to be called directly by applications | | Not intended to be called directly by applications | ||
|- | |- | ||
Line 4,741: | Line 4,741: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Not intended to be called directly by applications | | Not intended to be called directly by applications | ||
|- | |- | ||
Line 4,753: | Line 4,753: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Not intended to be called directly by applications | | Not intended to be called directly by applications | ||
|- | |- | ||
Line 4,765: | Line 4,765: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Not intended to be called directly by applications | | Not intended to be called directly by applications | ||
|- | |- | ||
Line 4,777: | Line 4,777: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Not intended to be called directly by applications | | Not intended to be called directly by applications | ||
|- | |- | ||
Line 4,789: | Line 4,789: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Not intended to be called directly by applications | | Not intended to be called directly by applications | ||
|- | |- | ||
Line 4,801: | Line 4,801: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Not intended to be called directly by applications | | Not intended to be called directly by applications | ||
|- | |- | ||
Line 4,813: | Line 4,813: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Called only during system startup | | Called only during system startup | ||
|- | |- | ||
Line 4,828: | Line 4,828: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Return |
| Handle of new Spin entry or INVALID_HANDLE_VALUE if entry could not be created | | Handle of new Spin entry or INVALID_HANDLE_VALUE if entry could not be created | ||
|- | |- | ||
Line 4,840: | Line 4,840: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! InitialOwner |
| If true set the state of the spin to locked and the owner to the current thread | | If true set the state of the spin to locked and the owner to the current thread | ||
|- | |- | ||
− | ! | + | ! Return |
| Handle of new Spin entry or INVALID_HANDLE_VALUE if entry could not be created | | Handle of new Spin entry or INVALID_HANDLE_VALUE if entry could not be created | ||
|- | |- | ||
Line 4,855: | Line 4,855: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Spin |
| Handle of Spin entry to destroy | | Handle of Spin entry to destroy | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 4,870: | Line 4,870: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Spin |
| Handle of Spin entry to get owner for | | Handle of Spin entry to get owner for | ||
|- | |- | ||
− | ! | + | ! Return |
| Handle of owning thread or INVALID_HANDLE_VALUE if not currently owned | | Handle of owning thread or INVALID_HANDLE_VALUE if not currently owned | ||
|- | |- | ||
Line 4,885: | Line 4,885: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Spin |
| Handle of Spin entry to lock | | Handle of Spin entry to lock | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 4,900: | Line 4,900: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Spin |
| Handle of Spin entry to unlock | | Handle of Spin entry to unlock | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 4,915: | Line 4,915: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Spin |
| Handle of Spin entry to lock | | Handle of Spin entry to lock | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 4,930: | Line 4,930: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Spin |
| Handle of Spin entry to unlock | | Handle of Spin entry to unlock | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 4,945: | Line 4,945: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Spin |
| Handle of Spin entry to lock | | Handle of Spin entry to lock | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 4,960: | Line 4,960: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Spin |
| Handle of Spin entry to unlock | | Handle of Spin entry to unlock | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 4,975: | Line 4,975: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Spin |
| Handle of Spin entry to lock | | Handle of Spin entry to lock | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 4,990: | Line 4,990: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Spin |
| Handle of Spin entry to unlock | | Handle of Spin entry to unlock | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 5,005: | Line 5,005: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Spin |
| Handle of Spin entry to lock | | Handle of Spin entry to lock | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| This is a convenience wrapper which determines the appropriate SpinLock call to disable preemption | | This is a convenience wrapper which determines the appropriate SpinLock call to disable preemption | ||
|- | |- | ||
Line 5,023: | Line 5,023: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Spin |
| Handle of Spin entry to unlock | | Handle of Spin entry to unlock | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| This is a convenience wrapper which determines the appropriate SpinUnlock call to enable preemption | | This is a convenience wrapper which determines the appropriate SpinUnlock call to enable preemption | ||
|- | |- | ||
Line 5,041: | Line 5,041: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Spin |
| Handle of Spin entry to check | | Handle of Spin entry to check | ||
|- | |- | ||
− | ! | + | ! Return |
| True if the mask would enable IRQ on restore, False if it would not | | True if the mask would enable IRQ on restore, False if it would not | ||
|- | |- | ||
− | ! | + | ! Note |
| The Spin entry must be locked by the current thread | | The Spin entry must be locked by the current thread | ||
|- | |- | ||
Line 5,059: | Line 5,059: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Spin |
| Handle of Spin entry to check | | Handle of Spin entry to check | ||
|- | |- | ||
− | ! | + | ! Return |
| True if the mask would enable FIQ on restore, False if it would not | | True if the mask would enable FIQ on restore, False if it would not | ||
− | + | ||
− | ! '''Note | + | ! '''Note |
| The Spin entry must be locked by the current thread | | The Spin entry must be locked by the current thread | ||
|- | |- | ||
Line 5,077: | Line 5,077: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Spin1 |
| Handle of first Spin entry | | Handle of first Spin entry | ||
|- | |- | ||
− | ! | + | ! Spin2 |
| Handle of second Spin entry | | Handle of second Spin entry | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| Both Spin entries must be locked by the current thread | | Both Spin entries must be locked by the current thread | ||
|- | |- | ||
Line 5,098: | Line 5,098: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Spin1 |
| Handle of first Spin entry | | Handle of first Spin entry | ||
|- | |- | ||
− | ! | + | ! Spin2 |
| Handle of second Spin entry | | Handle of second Spin entry | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| Both Spin entries must be locked by the current thread | | Both Spin entries must be locked by the current thread | ||
|- | |- | ||
Line 5,119: | Line 5,119: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Not intended to be called directly by applications, use SpinLock instead | | Not intended to be called directly by applications, use SpinLock instead | ||
|- | |- | ||
Line 5,131: | Line 5,131: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Not intended to be called directly by applications, use SpinUnlock instead | | Not intended to be called directly by applications, use SpinUnlock instead | ||
|- | |- | ||
Line 5,143: | Line 5,143: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Not intended to be called directly by applications, use SpinLockIRQ instead | | Not intended to be called directly by applications, use SpinLockIRQ instead | ||
|- | |- | ||
Line 5,155: | Line 5,155: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Not intended to be called directly by applications, use SpinUnlockIRQ instead | | Not intended to be called directly by applications, use SpinUnlockIRQ instead | ||
|- | |- | ||
Line 5,167: | Line 5,167: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Not intended to be called directly by applications, use SpinLockFIQ instead | | Not intended to be called directly by applications, use SpinLockFIQ instead | ||
|- | |- | ||
Line 5,179: | Line 5,179: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Not intended to be called directly by applications, use SpinUnlockFIQ instead | | Not intended to be called directly by applications, use SpinUnlockFIQ instead | ||
|- | |- | ||
Line 5,191: | Line 5,191: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Not intended to be called directly by applications, use SpinLockIRQFIQ instead | | Not intended to be called directly by applications, use SpinLockIRQFIQ instead | ||
|- | |- | ||
Line 5,203: | Line 5,203: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Not intended to be called directly by applications, use SpinUnlockIRQFIQ instead | | Not intended to be called directly by applications, use SpinUnlockIRQFIQ instead | ||
|- | |- | ||
Line 5,218: | Line 5,218: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Return |
| Handle of new Mutex entry or INVALID_HANDLE_VALUE if entry could not be created | | Handle of new Mutex entry or INVALID_HANDLE_VALUE if entry could not be created | ||
|- | |- | ||
Line 5,230: | Line 5,230: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! InitialOwner |
| If true set the state of the mutex to locked and the owner to the current thread | | If true set the state of the mutex to locked and the owner to the current thread | ||
|- | |- | ||
− | ! | + | ! SpinCount |
| The number of times the mutex will spin before yielding (Always 0 if CPU count equals 1) | | The number of times the mutex will spin before yielding (Always 0 if CPU count equals 1) | ||
|- | |- | ||
− | ! | + | ! Flags |
| The flags for the Mutex entry (eg MUTEX_FLAG_RECURSIVE) | | The flags for the Mutex entry (eg MUTEX_FLAG_RECURSIVE) | ||
|- | |- | ||
− | ! | + | ! Return |
| Handle of new Mutex entry or INVALID_HANDLE_VALUE if entry could not be created | | Handle of new Mutex entry or INVALID_HANDLE_VALUE if entry could not be created | ||
|- | |- | ||
Line 5,251: | Line 5,251: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Mutex |
| Handle of Mutex entry to destroy | | Handle of Mutex entry to destroy | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 5,266: | Line 5,266: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Mutex |
| Handle of Mutex entry to get flags for | | Handle of Mutex entry to get flags for | ||
|- | |- | ||
− | ! | + | ! Return |
| Current flags or INVALID_HANDLE_VALUE on error | | Current flags or INVALID_HANDLE_VALUE on error | ||
|- | |- | ||
Line 5,281: | Line 5,281: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Mutex |
| Mutex to get count for | | Mutex to get count for | ||
|- | |- | ||
− | ! | + | ! Return |
| Current lock count or INVALID_HANDLE_VALUE on error | | Current lock count or INVALID_HANDLE_VALUE on error | ||
|- | |- | ||
− | ! | + | ! Note |
| Count is only valid if Flags includes MUTEX_FLAG_RECURSIVE | | Count is only valid if Flags includes MUTEX_FLAG_RECURSIVE | ||
|- | |- | ||
Line 5,299: | Line 5,299: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Mutex |
| Handle of Mutex entry to get owner for | | Handle of Mutex entry to get owner for | ||
|- | |- | ||
− | ! | + | ! Return |
| Handle of owning thread or INVALID_HANDLE_VALUE if not currently owned | | Handle of owning thread or INVALID_HANDLE_VALUE if not currently owned | ||
|- | |- | ||
Line 5,314: | Line 5,314: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Mutex |
| Handle of Mutex entry to lock | | Handle of Mutex entry to lock | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 5,329: | Line 5,329: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Mutex |
| Handle of Mutex entry to unlock | | Handle of Mutex entry to unlock | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 5,344: | Line 5,344: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Mutex |
| Mutex to try to lock | | Mutex to try to lock | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed, ERROR_LOCKED if already locked or another error code on failure | | ERROR_SUCCESS if completed, ERROR_LOCKED if already locked or another error code on failure | ||
|- | |- | ||
Line 5,359: | Line 5,359: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Not intended to be called directly by applications, use MutexLock instead | | Not intended to be called directly by applications, use MutexLock instead | ||
|- | |- | ||
Line 5,371: | Line 5,371: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Not intended to be called directly by applications, use MutexUnlock instead | | Not intended to be called directly by applications, use MutexUnlock instead | ||
|- | |- | ||
Line 5,383: | Line 5,383: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Not intended to be called directly by applications, use MutexTryLock instead | | Not intended to be called directly by applications, use MutexTryLock instead | ||
|- | |- | ||
Line 5,398: | Line 5,398: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Return |
| Handle of new CriticalSection entry or INVALID_HANDLE_VALUE if entry could not be created | | Handle of new CriticalSection entry or INVALID_HANDLE_VALUE if entry could not be created | ||
|- | |- | ||
Line 5,410: | Line 5,410: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! CriticalSection |
| If true set the state of the criticalsection to locked and the owner to the current thread | | If true set the state of the criticalsection to locked and the owner to the current thread | ||
|- | |- | ||
− | ! | + | ! SpinCount |
| The number of times the criticalsection will spin before waiting (Always 0 if CPU count equals 1) | | The number of times the criticalsection will spin before waiting (Always 0 if CPU count equals 1) | ||
|- | |- | ||
− | ! | + | ! Return |
| Handle of new CriticalSection entry or INVALID_HANDLE_VALUE if entry could not be created | | Handle of new CriticalSection entry or INVALID_HANDLE_VALUE if entry could not be created | ||
|- | |- | ||
Line 5,428: | Line 5,428: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! CriticalSection |
| Handle of CriticalSection entry to destroy | | Handle of CriticalSection entry to destroy | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 5,443: | Line 5,443: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! CriticalSection |
| CriticalSection to get count for | | CriticalSection to get count for | ||
|- | |- | ||
− | ! | + | ! Return |
| Current lock count or INVALID_HANDLE_VALUE on error | | Current lock count or INVALID_HANDLE_VALUE on error | ||
|- | |- | ||
Line 5,458: | Line 5,458: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! CriticalSection |
| CriticalSection to get owner for | | CriticalSection to get owner for | ||
|- | |- | ||
− | ! | + | ! Return |
| Handle of owning thread or INVALID_HANDLE_VALUE if not currently owned | | Handle of owning thread or INVALID_HANDLE_VALUE if not currently owned | ||
|- | |- | ||
Line 5,473: | Line 5,473: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! CriticalSection |
| CriticalSection to set spin count for | | CriticalSection to set spin count for | ||
|- | |- | ||
− | ! | + | ! SpinCount |
| The spin count value to set | | The spin count value to set | ||
|- | |- | ||
− | ! | + | ! Return |
| Current spin count or INVALID_HANDLE_VALUE on error | | Current spin count or INVALID_HANDLE_VALUE on error | ||
|- | |- | ||
Line 5,491: | Line 5,491: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! CriticalSection |
| CriticalSection to lock | | CriticalSection to lock | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| If the CriticalSection is not locked then lock it, set the count to one and mark the owner as the current thread. If the CriticalSection is already locked by the current thread then increment the count and return immediately. If the CriticalSection is already locked by another thread then wait until it is unlocked. | | If the CriticalSection is not locked then lock it, set the count to one and mark the owner as the current thread. If the CriticalSection is already locked by the current thread then increment the count and return immediately. If the CriticalSection is already locked by another thread then wait until it is unlocked. | ||
|- | |- | ||
Line 5,509: | Line 5,509: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! CriticalSection |
| CriticalSection to lock | | CriticalSection to lock | ||
|- | |- | ||
− | ! | + | ! Timeout |
| Milliseconds to wait before timeout (0 equals do not wait, INFINITE equals wait forever) | | Milliseconds to wait before timeout (0 equals do not wait, INFINITE equals wait forever) | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| If the CriticalSection is not locked then lock it, set the count to one and mark the owner as the current thread. If the CriticalSection is already locked by the current thread then increment the count and return immediately. If the CriticalSection is already locked by another thread then wait until it is unlocked. | | If the CriticalSection is not locked then lock it, set the count to one and mark the owner as the current thread. If the CriticalSection is already locked by the current thread then increment the count and return immediately. If the CriticalSection is already locked by another thread then wait until it is unlocked. | ||
|- | |- | ||
Line 5,530: | Line 5,530: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! CriticalSection |
| CriticalSection to unlock | | CriticalSection to unlock | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| If the CriticalSection is locked by the current thread then decrement the count. If the count is greater than zero then return immediately. If the count reaches zero then unlock the CriticalSection and release the first thread waiting for it to be unlocked. If the CriticalSection is locked by another thread then return an error. If the CriticalSection is not locked then return an error. | | If the CriticalSection is locked by the current thread then decrement the count. If the count is greater than zero then return immediately. If the count reaches zero then unlock the CriticalSection and release the first thread waiting for it to be unlocked. If the CriticalSection is locked by another thread then return an error. If the CriticalSection is not locked then return an error. | ||
|- | |- | ||
Line 5,548: | Line 5,548: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! CriticalSection |
| CriticalSection to try to lock | | CriticalSection to try to lock | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed, ERROR_LOCKED if locked by another thread or another error code on failure | | ERROR_SUCCESS if completed, ERROR_LOCKED if locked by another thread or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| If the CriticalSection is not locked then lock it, set the count to one and mark the owner as the current thread. If the CriticalSection is already locked by the current thread then increment the count and return immediately. If the CriticalSection is already locked by another thread then return immediately with an error and do not wait for it to be unlocked. | | If the CriticalSection is not locked then lock it, set the count to one and mark the owner as the current thread. If the CriticalSection is already locked by the current thread then increment the count and return immediately. If the CriticalSection is already locked by another thread then return immediately with an error and do not wait for it to be unlocked. | ||
|- | |- | ||
Line 5,569: | Line 5,569: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Count |
| The initial count of the Semaphore (Must be greater than or equal to zero) | | The initial count of the Semaphore (Must be greater than or equal to zero) | ||
|- | |- | ||
− | ! | + | ! Return |
| Handle of new Semaphore entry or INVALID_HANDLE_VALUE if entry could not be created | | Handle of new Semaphore entry or INVALID_HANDLE_VALUE if entry could not be created | ||
|- | |- | ||
Line 5,584: | Line 5,584: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Count |
| The initial count of the Semaphore (Must be greater than or equal to zero) | | The initial count of the Semaphore (Must be greater than or equal to zero) | ||
|- | |- | ||
− | ! | + | ! Maximum |
| The maximum count of the Semaphore (Must be greater than one) | | The maximum count of the Semaphore (Must be greater than one) | ||
|- | |- | ||
− | ! | + | ! Flags |
| The flags for the Semaphore entry (eg SEMAPHORE_FLAG_IRQ) | | The flags for the Semaphore entry (eg SEMAPHORE_FLAG_IRQ) | ||
|- | |- | ||
− | ! | + | ! Return |
| Handle of new Semaphore entry or INVALID_HANDLE_VALUE if entry could not be created | | Handle of new Semaphore entry or INVALID_HANDLE_VALUE if entry could not be created | ||
|- | |- | ||
Line 5,605: | Line 5,605: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Semaphore |
| Handle of Semaphore entry to destroy | | Handle of Semaphore entry to destroy | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 5,620: | Line 5,620: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Semaphore |
| Semaphore to get count for | | Semaphore to get count for | ||
|- | |- | ||
− | ! | + | ! Return |
| Current count or INVALID_HANDLE_VALUE on error | | Current count or INVALID_HANDLE_VALUE on error | ||
|- | |- | ||
Line 5,635: | Line 5,635: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Semaphore |
| Semaphore to wait on | | Semaphore to wait on | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| If the Semaphore count is greater than zero it will be decremented and this function will return immediately. If the Semaphore count is zero the current thread will be put on a wait queue until the Semaphore is signalled by another thread calling SemaphoreSignal() or SemaphoreSignalEx(). | | If the Semaphore count is greater than zero it will be decremented and this function will return immediately. If the Semaphore count is zero the current thread will be put on a wait queue until the Semaphore is signalled by another thread calling SemaphoreSignal() or SemaphoreSignalEx(). | ||
|- | |- | ||
Line 5,653: | Line 5,653: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Semaphore |
| Semaphore to wait on | | Semaphore to wait on | ||
|- | |- | ||
− | ! | + | ! Timeout |
| Milliseconds to wait before timeout (0 equals do not wait, INFINITE equals wait forever) | | Milliseconds to wait before timeout (0 equals do not wait, INFINITE equals wait forever) | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| If the Semaphore count is greater than zero it will be decremented and this function will return immediately. If the Semaphore count is zero the current thread will be put on a wait queue until the Semaphore is signalled by another thread calling SemaphoreSignal() or SemaphoreSignalEx(). | | If the Semaphore count is greater than zero it will be decremented and this function will return immediately. If the Semaphore count is zero the current thread will be put on a wait queue until the Semaphore is signalled by another thread calling SemaphoreSignal() or SemaphoreSignalEx(). | ||
|- | |- | ||
Line 5,674: | Line 5,674: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Semaphore |
| Semaphore to signal | | Semaphore to signal | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| If any threads are waiting on the Semaphore then one thread will be woken up and placed on the ready queue. If no threads are waiting then the Semaphore count will be incremented by one. | | If any threads are waiting on the Semaphore then one thread will be woken up and placed on the ready queue. If no threads are waiting then the Semaphore count will be incremented by one. | ||
|- | |- | ||
Line 5,692: | Line 5,692: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Semaphore |
| Semaphore to signal | | Semaphore to signal | ||
|- | |- | ||
− | ! | + | ! Count |
| The number is times to signal the Semaphore, must be greater than zero. | | The number is times to signal the Semaphore, must be greater than zero. | ||
|- | |- | ||
− | ! | + | ! Previous |
| A pointer to a value that receives the previous count of the Semaphore. Can be nil if the previous count is not required. | | A pointer to a value that receives the previous count of the Semaphore. Can be nil if the previous count is not required. | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| If any threads are waiting on the Semaphore then one thread will be woken up and placed on the ready queue for each iteration of the count passed. If no threads are waiting then the Semaphore count will be incremented once for each iteration of the count passed. | | If any threads are waiting on the Semaphore then one thread will be woken up and placed on the ready queue for each iteration of the count passed. If no threads are waiting then the Semaphore count will be incremented once for each iteration of the count passed. | ||
|- | |- | ||
Line 5,719: | Line 5,719: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Return |
| Handle of new Synchronizer entry or INVALID_HANDLE_VALUE if entry could not be created | | Handle of new Synchronizer entry or INVALID_HANDLE_VALUE if entry could not be created | ||
|- | |- | ||
Line 5,731: | Line 5,731: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! InitialReader |
| If true set the state of the synchronizer to locked and the reader count to 1 | | If true set the state of the synchronizer to locked and the reader count to 1 | ||
|- | |- | ||
− | ! | + | ! InitialWriter |
| If true set the state of the synchronizer to locked and the writer owner to the current thread | | If true set the state of the synchronizer to locked and the writer owner to the current thread | ||
|- | |- | ||
− | ! | + | ! Return |
| Handle of new Synchronizer entry or INVALID_HANDLE_VALUE if entry could not be created | | Handle of new Synchronizer entry or INVALID_HANDLE_VALUE if entry could not be created | ||
|- | |- | ||
Line 5,749: | Line 5,749: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Synchronizer |
| Handle of Synchronizer entry to destroy | | Handle of Synchronizer entry to destroy | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 5,764: | Line 5,764: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Synchronizer |
| Synchronizer to get count for | | Synchronizer to get count for | ||
|- | |- | ||
− | ! | + | ! Return |
| Current reader count or INVALID_HANDLE_VALUE on error | | Current reader count or INVALID_HANDLE_VALUE on error | ||
|- | |- | ||
Line 5,779: | Line 5,779: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Synchronizer |
| Synchronizer to last reader for | | Synchronizer to last reader for | ||
|- | |- | ||
− | ! | + | ! Return |
| Last reader thread or INVALID_HANDLE_VALUE on error | | Last reader thread or INVALID_HANDLE_VALUE on error | ||
|- | |- | ||
Line 5,794: | Line 5,794: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Synchronizer |
| Synchronizer to lock | | Synchronizer to lock | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| If the Synchronizer is not locked then lock it and set the reader count to one. If the Synchronizer is already locked for reading then increment the reader count and return immediately. If the Synchronizer is already locked for writing then wait until it is unlocked. | | If the Synchronizer is not locked then lock it and set the reader count to one. If the Synchronizer is already locked for reading then increment the reader count and return immediately. If the Synchronizer is already locked for writing then wait until it is unlocked. | ||
|- | |- | ||
Line 5,812: | Line 5,812: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Synchronizer |
| Synchronizer to lock | | Synchronizer to lock | ||
|- | |- | ||
− | ! | + | ! Timeout |
| Milliseconds to wait before timeout (0 equals do not wait, INFINITE equals wait forever) | | Milliseconds to wait before timeout (0 equals do not wait, INFINITE equals wait forever) | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| If the Synchronizer is not locked then lock it and set the reader count to one. If the Synchronizer is already locked for reading then increment the reader count and return immediately. If the Synchronizer is already locked for writing then wait until it is unlocked. | | If the Synchronizer is not locked then lock it and set the reader count to one. If the Synchronizer is already locked for reading then increment the reader count and return immediately. If the Synchronizer is already locked for writing then wait until it is unlocked. | ||
|- | |- | ||
Line 5,833: | Line 5,833: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Synchronizer |
| Synchronizer to unlock | | Synchronizer to unlock | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| If the Synchronizer is locked for reading then decrement the count. If the count is greater than zero then return immediately. If the count reaches zero then unlock the Synchronizer and release the first writer thread waiting for it to be unlocked. If the Synchronizer is locked for writing then return an error. If the Synchronizer is not locked then return an error. | | If the Synchronizer is locked for reading then decrement the count. If the count is greater than zero then return immediately. If the count reaches zero then unlock the Synchronizer and release the first writer thread waiting for it to be unlocked. If the Synchronizer is locked for writing then return an error. If the Synchronizer is not locked then return an error. | ||
|- | |- | ||
Line 5,851: | Line 5,851: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Synchronizer |
| Synchronizer to convert | | Synchronizer to convert | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| If the Synchronizer is locked for reading then decrement the count. If the count is greater than zero then wait to acquire the writer lock. If the count reaches zero then convert to writer lock with the current thread as the owner. If the Synchronizer is locked for writing then return an error. If the Synchronizer is not locked then return an error. Since reader locks are recursive but do not maintain reader thread ownership, caller must ensure that one and only one reader lock is held by the current thread. | | If the Synchronizer is locked for reading then decrement the count. If the count is greater than zero then wait to acquire the writer lock. If the count reaches zero then convert to writer lock with the current thread as the owner. If the Synchronizer is locked for writing then return an error. If the Synchronizer is not locked then return an error. Since reader locks are recursive but do not maintain reader thread ownership, caller must ensure that one and only one reader lock is held by the current thread. | ||
|- | |- | ||
Line 5,869: | Line 5,869: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Synchronizer |
| Synchronizer to convert | | Synchronizer to convert | ||
|- | |- | ||
− | ! | + | ! Timeout |
| Milliseconds to wait before timeout (0 equals do not wait, INFINITE equals wait forever) | | Milliseconds to wait before timeout (0 equals do not wait, INFINITE equals wait forever) | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| If the Synchronizer is locked for reading then decrement the count. If the count is greater than zero then wait to acquire the writer lock. If the count reaches zero then convert to writer lock with the current thread as the owner. If the Synchronizer is locked for writing then return an error. If the Synchronizer is not locked then return an error. Since reader locks are recursive but do not maintain reader thread ownership, caller must ensure that one and only one reader lock is held by the current thread. | | If the Synchronizer is locked for reading then decrement the count. If the count is greater than zero then wait to acquire the writer lock. If the count reaches zero then convert to writer lock with the current thread as the owner. If the Synchronizer is locked for writing then return an error. If the Synchronizer is not locked then return an error. Since reader locks are recursive but do not maintain reader thread ownership, caller must ensure that one and only one reader lock is held by the current thread. | ||
|- | |- | ||
Line 5,890: | Line 5,890: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Synchronizer |
| Synchronizer to get count for | | Synchronizer to get count for | ||
|- | |- | ||
− | ! | + | ! Return |
| Current writer count or INVALID_HANDLE_VALUE on error | | Current writer count or INVALID_HANDLE_VALUE on error | ||
|- | |- | ||
Line 5,905: | Line 5,905: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Synchronizer |
| Synchronizer to get owner for | | Synchronizer to get owner for | ||
|- | |- | ||
− | ! | + | ! Return |
| Handle of owning thread or INVALID_HANDLE_VALUE if not currently owned | | Handle of owning thread or INVALID_HANDLE_VALUE if not currently owned | ||
|- | |- | ||
Line 5,920: | Line 5,920: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Synchronizer |
| Synchronizer to lock | | Synchronizer to lock | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| If the Synchronizer is not locked then lock it, set the writer count to one and mark the owner as the current thread. If the Synchronizer is already locked by the current thread then increment the writer count and return immediately. If the Synchronizer is already locked for reading then wait until it is unlocked. | | If the Synchronizer is not locked then lock it, set the writer count to one and mark the owner as the current thread. If the Synchronizer is already locked by the current thread then increment the writer count and return immediately. If the Synchronizer is already locked for reading then wait until it is unlocked. | ||
|- | |- | ||
Line 5,938: | Line 5,938: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Synchronizer |
| Synchronizer to lock | | Synchronizer to lock | ||
|- | |- | ||
− | ! | + | ! Timeout |
| Milliseconds to wait before timeout (0 equals do not wait, INFINITE equals wait forever) | | Milliseconds to wait before timeout (0 equals do not wait, INFINITE equals wait forever) | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| If the Synchronizer is not locked then lock it, set the writer count to one and mark the owner as the current thread. If the Synchronizer is already locked by the current thread then increment the writer count and return immediately. If the Synchronizer is already locked for reading then wait until it is unlocked. | | If the Synchronizer is not locked then lock it, set the writer count to one and mark the owner as the current thread. If the Synchronizer is already locked by the current thread then increment the writer count and return immediately. If the Synchronizer is already locked for reading then wait until it is unlocked. | ||
|- | |- | ||
Line 5,959: | Line 5,959: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Synchronizer |
| Synchronizer to unlock | | Synchronizer to unlock | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| If the Synchronizer is locked for writing by the current thread then decrement the count. If the count is greater than zero then return immediately. If the count reaches zero then unlock the Synchronizer and release all reader threads waiting for it to be unlocked or the first writer thread waiting for it to be unlocked. If the Synchronizer is locked for reading then return an error. If the Synchronizer is locked for writing by another thread then return an error. If the Synchronizer is not locked then return an error. | | If the Synchronizer is locked for writing by the current thread then decrement the count. If the count is greater than zero then return immediately. If the count reaches zero then unlock the Synchronizer and release all reader threads waiting for it to be unlocked or the first writer thread waiting for it to be unlocked. If the Synchronizer is locked for reading then return an error. If the Synchronizer is locked for writing by another thread then return an error. If the Synchronizer is not locked then return an error. | ||
|- | |- | ||
Line 5,977: | Line 5,977: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Synchronizer |
| Synchronizer to convert | | Synchronizer to convert | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| If the Synchronizer is locked for writing by the current thread and the count is one then decrement the count. If the count is greater than one then return an error. If the count reaches zero then convert to reader lock and release all waiting reader threads. If the Synchronizer is locked for reading then return an error. If the Synchronizer is not locked then return an error. Since writer locks are recursive, caller must ensure that one and only one writer lock is held by the current thread. | | If the Synchronizer is locked for writing by the current thread and the count is one then decrement the count. If the count is greater than one then return an error. If the count reaches zero then convert to reader lock and release all waiting reader threads. If the Synchronizer is locked for reading then return an error. If the Synchronizer is not locked then return an error. Since writer locks are recursive, caller must ensure that one and only one writer lock is held by the current thread. | ||
|- | |- | ||
Line 5,998: | Line 5,998: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Return |
| Handle of new Condition entry or INVALID_HANDLE_VALUE if entry could not be created | | Handle of new Condition entry or INVALID_HANDLE_VALUE if entry could not be created | ||
|- | |- | ||
Line 6,010: | Line 6,010: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Condition |
| Handle of Condition entry to destroy | | Handle of Condition entry to destroy | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 6,025: | Line 6,025: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Condition |
| Condition to wait on | | Condition to wait on | ||
|- | |- | ||
− | ! | + | ! Timeout |
| Time in milliseconds to wait to be woken | | Time in milliseconds to wait to be woken | ||
0 = No Wait | 0 = No Wait | ||
<br />INFINITE = Wait Indefinitely | <br />INFINITE = Wait Indefinitely | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 6,045: | Line 6,045: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Condition |
| Condition to wait on | | Condition to wait on | ||
|- | |- | ||
− | ! | + | ! Mutex |
| Mutex to release | | Mutex to release | ||
|- | |- | ||
− | ! | + | ! Timeout |
| Time in milliseconds to wait to be woken | | Time in milliseconds to wait to be woken | ||
0 = No Wait | 0 = No Wait | ||
<br />INFINITE = Wait Indefinitely | <br />INFINITE = Wait Indefinitely | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure. | | ERROR_SUCCESS if completed or another error code on failure. | ||
Before returning (with either success or failure) the thread will reacquire the Mutex. | Before returning (with either success or failure) the thread will reacquire the Mutex. | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must be the owner of the Mutex with a count of one on entry to this function | | Caller must be the owner of the Mutex with a count of one on entry to this function | ||
|- | |- | ||
Line 6,072: | Line 6,072: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Condition |
| Condition to wait on | | Condition to wait on | ||
|- | |- | ||
− | ! | + | ! Synchronizer |
| Synchronizer to release | | Synchronizer to release | ||
|- | |- | ||
− | ! | + | ! Flags |
| Flags to indicate reader or writer lock for the Synchronizer (eg CONDITION_LOCK_FLAG_WRITER) | | Flags to indicate reader or writer lock for the Synchronizer (eg CONDITION_LOCK_FLAG_WRITER) | ||
|- | |- | ||
− | ! | + | ! Timeout |
| Time in milliseconds to wait to be woken | | Time in milliseconds to wait to be woken | ||
0 = No Wait | 0 = No Wait | ||
<br />INFINITE = Wait Indefinitely | <br />INFINITE = Wait Indefinitely | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure. | | ERROR_SUCCESS if completed or another error code on failure. | ||
Before returning (with either success or failure) the thread will reacquire the Synchronizer for either reading or writing depending on the flags value. | Before returning (with either success or failure) the thread will reacquire the Synchronizer for either reading or writing depending on the flags value. | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must be the owner of the Synchronizer with a count of one on entry to this function and the ownership must match the flags value provided. | | Caller must be the owner of the Synchronizer with a count of one on entry to this function and the ownership must match the flags value provided. | ||
|- | |- | ||
Line 6,102: | Line 6,102: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Condition |
| Condition to wait on | | Condition to wait on | ||
|- | |- | ||
− | ! | + | ! CriticalSection |
| Critical Section to release | | Critical Section to release | ||
|- | |- | ||
− | ! | + | ! Timeout |
| Time in milliseconds to wait to be woken | | Time in milliseconds to wait to be woken | ||
0 = No Wait | 0 = No Wait | ||
<br />INFINITE = Wait Indefinitely | <br />INFINITE = Wait Indefinitely | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure. | | ERROR_SUCCESS if completed or another error code on failure. | ||
Before returning (with either success or failure) the thread will reacquire the Synchronizer for either reading or writing depending on the flags value. | Before returning (with either success or failure) the thread will reacquire the Synchronizer for either reading or writing depending on the flags value. | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must be the owner of the Critical Section with a count of one on entry to this function. | | Caller must be the owner of the Critical Section with a count of one on entry to this function. | ||
|- | |- | ||
Line 6,129: | Line 6,129: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Condition |
| Condition to wake | | Condition to wake | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 6,144: | Line 6,144: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Condition |
| Condition to wake | | Condition to wake | ||
|- | |- | ||
− | ! | + | ! Note |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 6,162: | Line 6,162: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| Not intended to be called directly by applications | | Not intended to be called directly by applications | ||
|- | |- | ||
Line 6,177: | Line 6,177: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| Not intended to be called directly by applications | | Not intended to be called directly by applications | ||
|- | |- | ||
Line 6,192: | Line 6,192: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Flags |
| The flags for the Completion entry (eg COMPLETION_FLAG_IRQ) | | The flags for the Completion entry (eg COMPLETION_FLAG_IRQ) | ||
|- | |- | ||
− | ! | + | ! Return |
| Handle of new Completion entry or INVALID_HANDLE_VALUE if entry could not be created | | Handle of new Completion entry or INVALID_HANDLE_VALUE if entry could not be created | ||
|- | |- | ||
Line 6,207: | Line 6,207: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Completion |
| Handle of Completion entry to destroy | | Handle of Completion entry to destroy | ||
|- | |- | ||
− | ! | + | ! Destroy |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 6,222: | Line 6,222: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Completion |
| Completion to get the state for | | Completion to get the state for | ||
|- | |- | ||
− | ! | + | ! Return |
| Current state (eg COMPLETION_STATE_COMPLETE) or INVALID_HANDLE_VALUE on error | | Current state (eg COMPLETION_STATE_COMPLETE) or INVALID_HANDLE_VALUE on error | ||
|- | |- | ||
Line 6,237: | Line 6,237: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Completion |
| Completion to wait on | | Completion to wait on | ||
|- | |- | ||
− | ! | + | ! Timeout |
| Time in milliseconds to wait to be woken | | Time in milliseconds to wait to be woken | ||
0 = No Wait | 0 = No Wait | ||
<br />INFINITE = Wait Indefinitely | <br />INFINITE = Wait Indefinitely | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| If the completion is set (complete) then return immediately with success. If the completion is not set then wait for it to be completed before returning. For counted completions, decrement the count if it is not 0 or -1 after testing if the completion is set. | | If the completion is set (complete) then return immediately with success. If the completion is not set then wait for it to be completed before returning. For counted completions, decrement the count if it is not 0 or -1 after testing if the completion is set. | ||
|- | |- | ||
Line 6,260: | Line 6,260: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Completion |
| Completion to try | | Completion to try | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed, ERROR_NOT_READY if not completed or another error code on failure | | ERROR_SUCCESS if completed, ERROR_NOT_READY if not completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| If the completion is not set (complete) then return immediately with an error and do not wait for it to be completed. | | If the completion is not set (complete) then return immediately with an error and do not wait for it to be completed. | ||
|- | |- | ||
Line 6,278: | Line 6,278: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Completion |
| Completion to reset the state for | | Completion to reset the state for | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| If the completion is not set then return with no action. If the completion is set then change the state to not set. For counted completions, reset the counter to 0. | | If the completion is not set then return with no action. If the completion is set then change the state to not set. For counted completions, reset the counter to 0. | ||
|- | |- | ||
Line 6,296: | Line 6,296: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Completion |
| Completion to set the state for | | Completion to set the state for | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| If the completion is already set then return with no action. If the completion is not set then release one waiting thread (if any) and return. For counted completions, release one waiting thread, if there are no waiting threads increment the count if it is not -1 and return. | | If the completion is already set then return with no action. If the completion is not set then release one waiting thread (if any) and return. For counted completions, release one waiting thread, if there are no waiting threads increment the count if it is not -1 and return. | ||
|- | |- | ||
Line 6,314: | Line 6,314: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Completion |
| Completion to set the state for | | Completion to set the state for | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| If the completion is already set then return with no action. If the completion is not set then release all waiting threads (if any) and return. For counted completions, set the count to -1, release all waiting threads (if any) and return. | | If the completion is already set then return with no action. If the completion is not set then release all waiting threads (if any) and return. For counted completions, set the count to -1, release all waiting threads (if any) and return. | ||
|- | |- | ||
Line 6,335: | Line 6,335: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Return |
| Handle of new List entry or INVALID_HANDLE_VALUE if entry could not be created | | Handle of new List entry or INVALID_HANDLE_VALUE if entry could not be created | ||
|- | |- | ||
Line 6,347: | Line 6,347: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! ListType |
| Type of list to create (eg LIST_TYPE_WAIT_SEMAPHORE) | | Type of list to create (eg LIST_TYPE_WAIT_SEMAPHORE) | ||
|- | |- | ||
− | ! | + | ! Flags |
| Flags for the new list (eg LIST_FLAG_IRQ) | | Flags for the new list (eg LIST_FLAG_IRQ) | ||
|- | |- | ||
− | ! | + | ! Return |
| Handle of new List entry or INVALID_HANDLE_VALUE if entry could not be created | | Handle of new List entry or INVALID_HANDLE_VALUE if entry could not be created | ||
|- | |- | ||
Line 6,365: | Line 6,365: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! List |
| Handle of List entry to destroy | | Handle of List entry to destroy | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| If list is part of a synchronisation object then caller must hold the lock on the object containing the list | | If list is part of a synchronisation object then caller must hold the lock on the object containing the list | ||
|- | |- | ||
Line 6,383: | Line 6,383: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! List |
| Handle of List entry to get from | | Handle of List entry to get from | ||
|- | |- | ||
− | ! | + | ! Return |
| List count on success or INVALID_HANDLE_VALUE on failure | | List count on success or INVALID_HANDLE_VALUE on failure | ||
|- | |- | ||
Line 6,398: | Line 6,398: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! List |
| Handle of List entry to add to | | Handle of List entry to add to | ||
|- | |- | ||
− | ! | + | ! Element |
| The list element to be added | | The list element to be added | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| If list is part of a synchronisation object then caller must hold the lock on the object containing the list | | If list is part of a synchronisation object then caller must hold the lock on the object containing the list | ||
|- | |- | ||
Line 6,419: | Line 6,419: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! List |
| Handle of List entry to add to | | Handle of List entry to add to | ||
|- | |- | ||
− | ! | + | ! Element |
| The list element to be added | | The list element to be added | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| If list is part of a synchronisation object then caller must hold the lock on the object containing the list | | If list is part of a synchronisation object then caller must hold the lock on the object containing the list | ||
|- | |- | ||
Line 6,440: | Line 6,440: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! List |
| Handle of List entry to find from | | Handle of List entry to find from | ||
|- | |- | ||
− | ! | + | ! Thread |
| The thread handle to be found | | The thread handle to be found | ||
|- | |- | ||
− | ! | + | ! Return |
| List element on success, nil on failure or list empty | | List element on success, nil on failure or list empty | ||
|- | |- | ||
− | ! | + | ! Note |
| If list is part of a synchronisation object then caller must hold the lock on the object containing the list | | If list is part of a synchronisation object then caller must hold the lock on the object containing the list | ||
|- | |- | ||
Line 6,461: | Line 6,461: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! List |
| Handle of List entry to get from | | Handle of List entry to get from | ||
|- | |- | ||
− | ! | + | ! Return |
| List element on success, nil on failure or list empty | | List element on success, nil on failure or list empty | ||
|- | |- | ||
− | ! | + | ! Note |
| If list is part of a synchronisation object then caller must hold the lock on the object containing the list | | If list is part of a synchronisation object then caller must hold the lock on the object containing the list | ||
|- | |- | ||
Line 6,479: | Line 6,479: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! List |
| Handle of List entry to get from | | Handle of List entry to get from | ||
|- | |- | ||
− | ! | + | ! Remove |
| If true then remove the element from the list | | If true then remove the element from the list | ||
|- | |- | ||
− | ! | + | ! Return |
| List element on success, nil on failure or list empty | | List element on success, nil on failure or list empty | ||
|- | |- | ||
− | ! | + | ! Note |
| If list is part of a synchronisation object then caller must hold the lock on the object containing the list | | If list is part of a synchronisation object then caller must hold the lock on the object containing the list | ||
|- | |- | ||
Line 6,500: | Line 6,500: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! List |
| Handle of List entry to get from | | Handle of List entry to get from | ||
|- | |- | ||
− | ! | + | ! Return |
| List element on success, nil on failure or list empty | | List element on success, nil on failure or list empty | ||
|- | |- | ||
− | ! | + | ! Note |
| If list is part of a synchronisation object then caller must hold the lock on the object containing the list | | If list is part of a synchronisation object then caller must hold the lock on the object containing the list | ||
|- | |- | ||
Line 6,518: | Line 6,518: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! List |
| Handle of List entry to get from | | Handle of List entry to get from | ||
|- | |- | ||
− | ! | + | ! Remove |
| If true then remove the element from the list | | If true then remove the element from the list | ||
|- | |- | ||
− | ! | + | ! Return |
| List element on success, nil on failure or list empty | | List element on success, nil on failure or list empty | ||
|- | |- | ||
− | ! | + | ! Note |
| If list is part of a synchronisation object then caller must hold the lock on the object containing the list | | If list is part of a synchronisation object then caller must hold the lock on the object containing the list | ||
|- | |- | ||
Line 6,539: | Line 6,539: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! List |
| Handle of List entry to insert into | | Handle of List entry to insert into | ||
|- | |- | ||
− | ! | + | ! Previous |
| The element to insert the new element after | | The element to insert the new element after | ||
|- | |- | ||
− | ! | + | ! Element |
| The list element to be inserted | | The list element to be inserted | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| If list is part of a synchronisation object then caller must hold the lock on the object containing the list | | If list is part of a synchronisation object then caller must hold the lock on the object containing the list | ||
|- | |- | ||
Line 6,563: | Line 6,563: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! List |
| Handle of List entry to remove from | | Handle of List entry to remove from | ||
|- | |- | ||
− | ! | + | ! Element |
| The list element to be removed | | The list element to be removed | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| If list is part of a synchronisation object then caller must hold the lock on the object containing the list | | If list is part of a synchronisation object then caller must hold the lock on the object containing the list | ||
|- | |- | ||
Line 6,584: | Line 6,584: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! List |
| Handle of List entry to check | | Handle of List entry to check | ||
|- | |- | ||
− | ! | + | ! Return |
| True if List is empty or does not exist, False if List is not empty | | True if List is empty or does not exist, False if List is not empty | ||
|- | |- | ||
− | ! | + | ! Note |
| If list is part of a synchronisation object then caller must hold the lock on the object containing the list | | If list is part of a synchronisation object then caller must hold the lock on the object containing the list | ||
|- | |- | ||
Line 6,602: | Line 6,602: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! List |
| Handle of List entry to check | | Handle of List entry to check | ||
|- | |- | ||
− | ! | + | ! Return |
| True if List is not empty, False if List is empty or does not exist | | True if List is not empty, False if List is empty or does not exist | ||
|- | |- | ||
− | ! | + | ! Note |
| If list is part of a synchronisation object then caller must hold the lock on the object containing the list | | If list is part of a synchronisation object then caller must hold the lock on the object containing the list | ||
|- | |- | ||
Line 6,620: | Line 6,620: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! List |
| Handle of List entry to lock | | Handle of List entry to lock | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 6,635: | Line 6,635: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! List |
| Handle of List entry to unlock | | Handle of List entry to unlock | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 6,650: | Line 6,650: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! List |
| Handle of List entry to lock | | Handle of List entry to lock | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 6,665: | Line 6,665: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! List |
| Handle of List entry to unlock | | Handle of List entry to unlock | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 6,683: | Line 6,683: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Return |
| Handle of new Queue entry or INVALID_HANDLE_VALUE if entry could not be created | | Handle of new Queue entry or INVALID_HANDLE_VALUE if entry could not be created | ||
|- | |- | ||
Line 6,695: | Line 6,695: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! QueueType |
| Type of queue to create (eg QUEUE_TYPE_SCHEDULE_SLEEP) | | Type of queue to create (eg QUEUE_TYPE_SCHEDULE_SLEEP) | ||
|- | |- | ||
− | ! | + | ! Flags |
| Flags for the new queue (eg QUEUE_FLAG_DESCENDING) | | Flags for the new queue (eg QUEUE_FLAG_DESCENDING) | ||
|- | |- | ||
− | ! | + | ! Return |
| Handle of new Queue entry or INVALID_HANDLE_VALUE if entry could not be created | | Handle of new Queue entry or INVALID_HANDLE_VALUE if entry could not be created | ||
|- | |- | ||
Line 6,713: | Line 6,713: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Queue |
| Handle of Queue entry to destroy | | Handle of Queue entry to destroy | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 6,728: | Line 6,728: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! List |
| Handle of Queue entry to get from | | Handle of Queue entry to get from | ||
|- | |- | ||
− | ! | + | ! Return |
| Queue count on success or INVALID_HANDLE_VALUE on failure | | Queue count on success or INVALID_HANDLE_VALUE on failure | ||
|- | |- | ||
Line 6,743: | Line 6,743: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Queue |
| Handle of Queue entry to add to | | Handle of Queue entry to add to | ||
|- | |- | ||
− | ! | + | ! Thread |
| Handle of the Thread to enqueue | | Handle of the Thread to enqueue | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| If queue is a scheduler queue then caller must hold the lock on the thread | | If queue is a scheduler queue then caller must hold the lock on the thread | ||
|- | |- | ||
Line 6,764: | Line 6,764: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Queue |
| Handle of Queue entry to get from | | Handle of Queue entry to get from | ||
|- | |- | ||
− | ! | + | ! Return |
| Handle of dequeued Thread or INVALID_HANDLE_VALUE on failure | | Handle of dequeued Thread or INVALID_HANDLE_VALUE on failure | ||
|- | |- | ||
Line 6,779: | Line 6,779: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Queue |
| Handle of Queue entry to get from | | Handle of Queue entry to get from | ||
|- | |- | ||
− | ! | + | ! Return |
| First Key value from queue or QUEUE_KEY_NONE on failure | | First Key value from queue or QUEUE_KEY_NONE on failure | ||
|- | |- | ||
Line 6,794: | Line 6,794: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Queue |
| Handle of Queue entry to get from | | Handle of Queue entry to get from | ||
|- | |- | ||
− | ! | + | ! Return |
| Last Key value from queue or QUEUE_KEY_NONE on failure | | Last Key value from queue or QUEUE_KEY_NONE on failure | ||
|- | |- | ||
Line 6,809: | Line 6,809: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Queue |
| Handle of Queue entry to insert into | | Handle of Queue entry to insert into | ||
|- | |- | ||
− | ! | + | ! Thread |
| Handle of thread to be inserted | | Handle of thread to be inserted | ||
|- | |- | ||
− | ! | + | ! Key |
| The key to order the insertion on | | The key to order the insertion on | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| If queue is a scheduler queue then caller must hold the lock on the thread} | | If queue is a scheduler queue then caller must hold the lock on the thread} | ||
|- | |- | ||
Line 6,833: | Line 6,833: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Queue |
| Handle of Queue entry to delete from | | Handle of Queue entry to delete from | ||
|- | |- | ||
− | ! | + | ! Thread |
| Handle of thread to be deleted | | Handle of thread to be deleted | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| If queue is a scheduler queue then caller must hold the lock on the thread | | If queue is a scheduler queue then caller must hold the lock on the thread | ||
|- | |- | ||
Line 6,854: | Line 6,854: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Queue |
| Handle of Queue entry to increment in | | Handle of Queue entry to increment in | ||
|- | |- | ||
− | ! | + | ! Return |
| First Key value in queue after increment or QUEUE_KEY_NONE on failure | | First Key value in queue after increment or QUEUE_KEY_NONE on failure | ||
|- | |- | ||
Line 6,869: | Line 6,869: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Queue |
| Handle of Queue entry to decrement in | | Handle of Queue entry to decrement in | ||
|- | |- | ||
− | ! | + | ! Return |
| First Key value in queue after decrement or QUEUE_KEY_NONE on failure | | First Key value in queue after decrement or QUEUE_KEY_NONE on failure | ||
|- | |- | ||
Line 6,884: | Line 6,884: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Queue |
| Handle of Queue entry to check | | Handle of Queue entry to check | ||
|- | |- | ||
− | ! | + | ! Return |
| True if Queue is empty or does not exist, False if Queue is not empty | | True if Queue is empty or does not exist, False if Queue is not empty | ||
|- | |- | ||
Line 6,899: | Line 6,899: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Queue |
| Handle of Queue entry to check | | Handle of Queue entry to check | ||
|- | |- | ||
− | ! | + | ! Return |
| True if Queue is not empty, False if Queue is empty or does not exist | | True if Queue is not empty, False if Queue is empty or does not exist | ||
|- | |- | ||
Line 6,914: | Line 6,914: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Queue |
| Handle of Queue entry to lock | | Handle of Queue entry to lock | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 6,929: | Line 6,929: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Queue |
| Handle of Queue entry to unlock | | Handle of Queue entry to unlock | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 6,947: | Line 6,947: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! StartProc |
| Procedure address where the thread will start running | | Procedure address where the thread will start running | ||
|- | |- | ||
− | ! | + | ! StackSize |
| Stack size in bytes | | Stack size in bytes | ||
|- | |- | ||
− | ! | + | ! Priority |
| Thread priority (eg THREAD_PRIORITY_NORMAL) | | Thread priority (eg THREAD_PRIORITY_NORMAL) | ||
|- | |- | ||
− | ! | + | ! Name |
− | | | + | | Name of the thread |
|- | |- | ||
− | ! | + | ! Parameter |
| Parameter passed to StartProc of new thread | | Parameter passed to StartProc of new thread | ||
|- | |- | ||
− | ! | + | ! Return |
| Handle of new thread or INVALID_HANDLE_VALUE if a new thread could not be created | | Handle of new thread or INVALID_HANDLE_VALUE if a new thread could not be created | ||
|- | |- | ||
− | ! | + | ! Note |
| The new thread will be created suspended so it will not start running until it is scheduled with either ThreadReady or ThreadResume. Calls ThreadCreateEx with: Affinity = SCHEDULER_CPU_MASK (Run on any available CPU) CPU = SchedulerThreadNext (Assign to next CPU in round robin). | | The new thread will be created suspended so it will not start running until it is scheduled with either ThreadReady or ThreadResume. Calls ThreadCreateEx with: Affinity = SCHEDULER_CPU_MASK (Run on any available CPU) CPU = SchedulerThreadNext (Assign to next CPU in round robin). | ||
|- | |- | ||
− | ! | + | ! Warning |
| ThreadCreate and ThreadCreateEx are only used internally by SysBeginThread and SysBeginThreadEx. These functions do not handle setting up certain RTL functionality such as thread variables, exceptions and standard input/output handles. If you need to create a standard thread use either BeginThread (or BeginThreadEx) or use the TThread class and its descendants. Only use ThreadCreate and ThreadCreateEx if you need to modify the thread creation behaviour and understand that you also need to handle the additional RTL setup. | | ThreadCreate and ThreadCreateEx are only used internally by SysBeginThread and SysBeginThreadEx. These functions do not handle setting up certain RTL functionality such as thread variables, exceptions and standard input/output handles. If you need to create a standard thread use either BeginThread (or BeginThreadEx) or use the TThread class and its descendants. Only use ThreadCreate and ThreadCreateEx if you need to modify the thread creation behaviour and understand that you also need to handle the additional RTL setup. | ||
|- | |- | ||
Line 6,980: | Line 6,980: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! StartProc |
| Procedure address where the thread will start running | | Procedure address where the thread will start running | ||
|- | |- | ||
− | ! | + | ! StackSize |
| Stack size in bytes | | Stack size in bytes | ||
|- | |- | ||
− | ! | + | ! Priority |
| Thread priority (eg THREAD_PRIORITY_NORMAL) | | Thread priority (eg THREAD_PRIORITY_NORMAL) | ||
|- | |- | ||
− | ! | + | ! Affinity |
| Thread affinity (eg CPU_AFFINITY_ALL) | | Thread affinity (eg CPU_AFFINITY_ALL) | ||
|- | |- | ||
− | ! | + | ! CPU |
− | | The CPU to assign new thread to | + | | The CPU to assign new thread to |
|- | |- | ||
− | ! | + | ! Name |
| Name of the thread | | Name of the thread | ||
|- | |- | ||
− | ! | + | ! Parameter |
| Parameter passed to StartProc of new thread | | Parameter passed to StartProc of new thread | ||
|- | |- | ||
− | ! | + | ! Return |
| Handle of new thread or INVALID_HANDLE_VALUE if a new thread could not be created | | Handle of new thread or INVALID_HANDLE_VALUE if a new thread could not be created | ||
|- | |- | ||
− | ! | + | ! Note |
| The new thread will be created suspended so it will not start running until it is scheduled with either ThreadReady or ThreadResume. | | The new thread will be created suspended so it will not start running until it is scheduled with either ThreadReady or ThreadResume. | ||
|- | |- | ||
− | ! | + | ! Warning |
| ThreadCreate and ThreadCreateEx are only used internally by SysBeginThread and SysBeginThreadEx. These functions do not handle setting up certain RTL functionality such as thread variables, exceptions and standard input/output handles. If you need to create a standard thread use either BeginThread (or BeginThreadEx) or use the TThread class or its descendants. Only use ThreadCreate and ThreadCreateEx if you need to modify the thread creation behaviour and understand that you also need to handle the additional RTL setup | | ThreadCreate and ThreadCreateEx are only used internally by SysBeginThread and SysBeginThreadEx. These functions do not handle setting up certain RTL functionality such as thread variables, exceptions and standard input/output handles. If you need to create a standard thread use either BeginThread (or BeginThreadEx) or use the TThread class or its descendants. Only use ThreadCreate and ThreadCreateEx if you need to modify the thread creation behaviour and understand that you also need to handle the additional RTL setup | ||
|- | |- | ||
Line 7,019: | Line 7,019: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Thread |
| Handle of thread to destroy | | Handle of thread to destroy | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 7,034: | Line 7,034: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Return |
| Thread handle of the currently running thread | | Thread handle of the currently running thread | ||
|- | |- | ||
Line 7,046: | Line 7,046: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| Must not be called except during initialization | | Must not be called except during initialization | ||
|- | |- | ||
Line 7,061: | Line 7,061: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Thread |
| Handle of thread to get | | Handle of thread to get | ||
|- | |- | ||
− | ! | + | ! Return |
| Name of thread or empty string on failure | | Name of thread or empty string on failure | ||
|- | |- | ||
Line 7,076: | Line 7,076: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Thread |
| Handle of thread to set | | Handle of thread to set | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 7,091: | Line 7,091: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Thread |
| Handle of thread to get | | Handle of thread to get | ||
|- | |- | ||
− | ! | + | ! Return |
| CPU of the thread or INVALID_HANDLE_VALUE on failure | | CPU of the thread or INVALID_HANDLE_VALUE on failure | ||
|- | |- | ||
Line 7,106: | Line 7,106: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Thread |
| Handle of thread to set | | Handle of thread to set | ||
|- | |- | ||
− | ! | + | ! CPU |
| New thread CPU (eg CPU_ID_0) | | New thread CPU (eg CPU_ID_0) | ||
|- | |- | ||
− | ! | + | ! Return |
| Previous CPU of thread or INVALID_HANDLE_VALUE on failure | | Previous CPU of thread or INVALID_HANDLE_VALUE on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| The new CPU will not take affect until the thread is next rescheduled | | The new CPU will not take affect until the thread is next rescheduled | ||
|- | |- | ||
Line 7,127: | Line 7,127: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Thread |
| Handle of thread to get | | Handle of thread to get | ||
|- | |- | ||
− | ! | + | ! Return |
| State of the thread or INVALID_HANDLE_VALUE on failure | | State of the thread or INVALID_HANDLE_VALUE on failure | ||
|- | |- | ||
Line 7,142: | Line 7,142: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Thread |
| Handle of thread to get | | Handle of thread to get | ||
|- | |- | ||
− | ! | + | ! Return |
| Flags of the thread (eg THREAD_FLAG_PERSIST) or INVALID_HANDLE_VALUE on failure | | Flags of the thread (eg THREAD_FLAG_PERSIST) or INVALID_HANDLE_VALUE on failure | ||
|- | |- | ||
Line 7,157: | Line 7,157: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Thread |
| Handle of thread to set | | Handle of thread to set | ||
|- | |- | ||
− | ! | + | ! Flags |
| Flags to set (eg THREAD_FLAG_PERSIST) | | Flags to set (eg THREAD_FLAG_PERSIST) | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 7,175: | Line 7,175: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Thread |
| Handle of thread to add flags for | | Handle of thread to add flags for | ||
|- | |- | ||
− | ! | + | ! Flags |
| Flags to add (eg THREAD_FLAG_PERSIST) | | Flags to add (eg THREAD_FLAG_PERSIST) | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 7,193: | Line 7,193: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Thread |
| Handle of thread to remove flags from | | Handle of thread to remove flags from | ||
|- | |- | ||
− | ! | + | ! Flags |
| Flags to remove (eg THREAD_FLAG_PERSIST) | | Flags to remove (eg THREAD_FLAG_PERSIST) | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 7,211: | Line 7,211: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Thread |
| Handle of thread to get | | Handle of thread to get | ||
|- | |- | ||
− | ! | + | ! Return |
| Locale of the thread or INVALID_HANDLE_VALUE on failure | | Locale of the thread or INVALID_HANDLE_VALUE on failure | ||
|- | |- | ||
Line 7,226: | Line 7,226: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Thread |
| Handle of thread to set | | Handle of thread to set | ||
|- | |- | ||
− | ! | + | ! Locale |
| Locale Id to set | | Locale Id to set | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 7,244: | Line 7,244: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Thread |
| Handle of thread to get | | Handle of thread to get | ||
|- | |- | ||
− | ! | + | ! CreateTime |
| Buffer to receive the CreateTime value | | Buffer to receive the CreateTime value | ||
|- | |- | ||
− | ! | + | ! ExitTime |
| Buffer to receive the ExitTime value | | Buffer to receive the ExitTime value | ||
|- | |- | ||
− | ! | + | ! KernelTime |
| Buffer to receive the KernelTime value | | Buffer to receive the KernelTime value | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 7,268: | Line 7,268: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Thread |
| Handle of thread to get | | Handle of thread to get | ||
|- | |- | ||
− | ! | + | ! SwitchCount |
| Buffer to receive the SwitchCount value | | Buffer to receive the SwitchCount value | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 7,286: | Line 7,286: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Return |
| Free stack size of the current thread or 0 on error | | Free stack size of the current thread or 0 on error | ||
|- | |- | ||
− | ! | + | ! Note |
| No lock required as only ever called by the thread itself | | No lock required as only ever called by the thread itself | ||
|- | |- | ||
Line 7,301: | Line 7,301: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Thread |
| Handle of thread to get | | Handle of thread to get | ||
|- | |- | ||
− | ! | + | ! Return |
| Stack size of the thread or INVALID_HANDLE_VALUE on failure | | Stack size of the thread or INVALID_HANDLE_VALUE on failure | ||
|- | |- | ||
Line 7,316: | Line 7,316: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Thread |
| Handle of thread to get | | Handle of thread to get | ||
|- | |- | ||
− | ! | + | ! Return |
| Stack base of the thread or INVALID_HANDLE_VALUE on failure | | Stack base of the thread or INVALID_HANDLE_VALUE on failure | ||
|- | |- | ||
Line 7,331: | Line 7,331: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Thread |
| Handle of thread to set | | Handle of thread to set | ||
|- | |- | ||
− | ! | + | ! StackBase |
| Stack base to set | | Stack base to set | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| Must not be called except during initialization | | Must not be called except during initialization | ||
|- | |- | ||
Line 7,352: | Line 7,352: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Thread |
| Handle of thread to get | | Handle of thread to get | ||
|- | |- | ||
− | ! | + | ! Return |
| Stack pointer of the thread or INVALID_HANDLE_VALUE on failure | | Stack pointer of the thread or INVALID_HANDLE_VALUE on failure | ||
|- | |- | ||
Line 7,367: | Line 7,367: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Thread |
| Handle of thread to get | | Handle of thread to get | ||
|- | |- | ||
− | ! | + | ! Return |
| Exit code of thread, STILL_ACTIVE if the thread has not terminated or INVALID_HANDLE_VALUE on failure | | Exit code of thread, STILL_ACTIVE if the thread has not terminated or INVALID_HANDLE_VALUE on failure | ||
|- | |- | ||
Line 7,382: | Line 7,382: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Thread |
| Handle of thread to get | | Handle of thread to get | ||
|- | |- | ||
− | ! | + | ! Return |
| Affinity of thread or INVALID_HANDLE_VALUE on failure | | Affinity of thread or INVALID_HANDLE_VALUE on failure | ||
|- | |- | ||
Line 7,397: | Line 7,397: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Thread |
| Handle of thread to set | | Handle of thread to set | ||
|- | |- | ||
− | ! | + | ! Affinity |
| New thread affinity (eg CPU_AFFINITY_0) | | New thread affinity (eg CPU_AFFINITY_0) | ||
|- | |- | ||
− | ! | + | ! Return |
| Previous affinity of thread or INVALID_HANDLE_VALUE on failure | | Previous affinity of thread or INVALID_HANDLE_VALUE on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| The new affinity will not take affect until the thread is next rescheduled | | The new affinity will not take affect until the thread is next rescheduled | ||
|- | |- | ||
Line 7,418: | Line 7,418: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Thread |
| Handle of thread to get | | Handle of thread to get | ||
|- | |- | ||
− | ! | + | ! Return |
| Priority of thread or INVALID_HANDLE_VALUE on failure | | Priority of thread or INVALID_HANDLE_VALUE on failure | ||
|- | |- | ||
Line 7,433: | Line 7,433: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Thread |
| Handle of thread to set | | Handle of thread to set | ||
|- | |- | ||
− | ! | + | ! Priority |
| New thread priority (eg THREAD_PRIORITY_NORMAL) | | New thread priority (eg THREAD_PRIORITY_NORMAL) | ||
|- | |- | ||
− | ! | + | ! Return |
| Previous priority of thread or INVALID_HANDLE_VALUE on failure | | Previous priority of thread or INVALID_HANDLE_VALUE on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| The new priority will not take affect until the thread is next rescheduled | | The new priority will not take affect until the thread is next rescheduled | ||
|- | |- | ||
Line 7,454: | Line 7,454: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Return |
| Last Error of thread or ERROR_SUCCESS if no error | | Last Error of thread or ERROR_SUCCESS if no error | ||
|- | |- | ||
− | ! | + | ! Note |
| No lock required as only ever called by the thread itself | | No lock required as only ever called by the thread itself | ||
|- | |- | ||
Line 7,469: | Line 7,469: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| No lock required as only ever called by the thread itself | | No lock required as only ever called by the thread itself | ||
|- | |- | ||
Line 7,481: | Line 7,481: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| No lock required as only ever called by the thread itself | | No lock required as only ever called by the thread itself | ||
|- | |- | ||
Line 7,496: | Line 7,496: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Return |
| Result of last wait timeout or ERROR_SUCCESS if no error | | Result of last wait timeout or ERROR_SUCCESS if no error | ||
|- | |- | ||
− | ! | + | ! Note |
| No lock required as only ever called by the thread itself | | No lock required as only ever called by the thread itself | ||
|- | |- | ||
Line 7,511: | Line 7,511: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Return |
| Result of last receive timeout or ERROR_SUCCESS if no error | | Result of last receive timeout or ERROR_SUCCESS if no error | ||
|- | |- | ||
− | ! | + | ! Note |
| No lock required as only ever called by the thread itself | | No lock required as only ever called by the thread itself | ||
|- | |- | ||
Line 7,526: | Line 7,526: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! TlsIndex |
| The TLS index to get the status for | | The TLS index to get the status for | ||
|- | |- | ||
− | ! | + | ! Return |
| THREAD_TLS_FREE if unused, THREAD_TLS_USED if in use or THREAD_TLS_INVALID on error | | THREAD_TLS_FREE if unused, THREAD_TLS_USED if in use or THREAD_TLS_INVALID on error | ||
|- | |- | ||
− | ! | + | ! Note |
| No lock required as only ever reads from the table | | No lock required as only ever reads from the table | ||
|- | |- | ||
Line 7,544: | Line 7,544: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Return |
| Allocated TLS index or TLS_OUT_OF_INDEXES on failure | | Allocated TLS index or TLS_OUT_OF_INDEXES on failure | ||
|- | |- | ||
Line 7,556: | Line 7,556: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Flags |
| The flags to apply to the TLS index entries (eg THREAD_TLS_FLAG_FREE) | | The flags to apply to the TLS index entries (eg THREAD_TLS_FLAG_FREE) | ||
|- | |- | ||
− | ! | + | ! Return |
| Allocated TLS index or TLS_OUT_OF_INDEXES on failure | | Allocated TLS index or TLS_OUT_OF_INDEXES on failure | ||
|- | |- | ||
Line 7,571: | Line 7,571: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! TlsIndex |
| The TLS index to deallocate | | The TLS index to deallocate | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 7,586: | Line 7,586: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Return |
| Pointer for the specified TLS index or nil if not set or on error | | Pointer for the specified TLS index or nil if not set or on error | ||
|- | |- | ||
− | ! | + | ! Note |
| No lock required as only ever called by the thread itself | | No lock required as only ever called by the thread itself | ||
|- | |- | ||
Line 7,601: | Line 7,601: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! TlsIndex |
| The TLS index to get the pointer for | | The TLS index to get the pointer for | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| No lock required as only ever called by the thread itself | | No lock required as only ever called by the thread itself | ||
|- | |- | ||
Line 7,619: | Line 7,619: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Thread |
| Handle of thread to get | | Handle of thread to get | ||
|- | |- | ||
− | ! | + | ! Return |
| Pointer to the RTL TLS of thread or nil on failure | | Pointer to the RTL TLS of thread or nil on failure | ||
|- | |- | ||
Line 7,634: | Line 7,634: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Thread |
| Handle of thread to set | | Handle of thread to set | ||
|- | |- | ||
− | ! | + | ! TlsPointer |
| Pointer value to set (Can be nil to clear the pointer) | | Pointer value to set (Can be nil to clear the pointer) | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 7,652: | Line 7,652: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Thread |
| Handle of thread to make ready | | Handle of thread to make ready | ||
|- | |- | ||
− | ! | + | ! Reschedule |
| If True then call SchedulerReschedule | | If True then call SchedulerReschedule | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| When called by the scheduler, thread has already been removed from the sleep queue | | When called by the scheduler, thread has already been removed from the sleep queue | ||
|- | |- | ||
Line 7,673: | Line 7,673: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Thread |
| Handle of thread to make ready | | Handle of thread to make ready | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| When called by the scheduler, thread has already been removed from the timeout queue | | When called by the scheduler, thread has already been removed from the timeout queue | ||
|- | |- | ||
Line 7,691: | Line 7,691: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Thread |
| Handle of thread to remove | | Handle of thread to remove | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| A thread that was sleeping will simply return early. A thread that was waiting or receiving with a timeout will return with the error WAIT_TIMEOUT. A thread that was waiting or receiving with INFINITE timeout will return with the error WAIT_ABANDONED. | | A thread that was sleeping will simply return early. A thread that was waiting or receiving with a timeout will return with the error WAIT_TIMEOUT. A thread that was waiting or receiving with INFINITE timeout will return with the error WAIT_ABANDONED. | ||
|- | |- | ||
Line 7,709: | Line 7,709: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Thread |
| Handle of thread to migrate | | Handle of thread to migrate | ||
|- | |- | ||
− | ! | + | ! CPU |
| New CPU for the thread | | New CPU for the thread | ||
|- | |- | ||
− | ! | + | ! Return |
| Previous CPU of thread or INVALID_HANDLE_VALUE on failure | | Previous CPU of thread or INVALID_HANDLE_VALUE on failure | ||
|- | |- | ||
Line 7,727: | Line 7,727: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! ExitCode |
| The return code of the thread | | The return code of the thread | ||
|- | |- | ||
Line 7,739: | Line 7,739: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! ExitCode |
| The return code of the thread | | The return code of the thread | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| Normally only called due to an unhandled exception etc so that the thread is put to sleep permanently without being terminated | | Normally only called due to an unhandled exception etc so that the thread is put to sleep permanently without being terminated | ||
|- | |- | ||
Line 7,757: | Line 7,757: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Thread |
| Handle of thread to terminate | | Handle of thread to terminate | ||
|- | |- | ||
− | ! | + | ! ExitCode |
| The return code of the thread | | The return code of the thread | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| The terminated thread is placed on the termination queue until any threads waiting on it have been released | | The terminated thread is placed on the termination queue until any threads waiting on it have been released | ||
|- | |- | ||
Line 7,778: | Line 7,778: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 7,790: | Line 7,790: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Milliseconds |
− | | | + | | Number of milliseconds to sleep |
|- | |- | ||
|} | |} | ||
Line 7,805: | Line 7,805: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! List |
| Handle of List entry to put thread into | | Handle of List entry to put thread into | ||
|- | |- | ||
− | ! | + | ! Lock |
| Handle of Lock to release before going into wait state | | Handle of Lock to release before going into wait state | ||
|- | |- | ||
− | ! | + | ! Flags |
| Flag to indicate which unlock method to use | | Flag to indicate which unlock method to use | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the lock on the synchronisation object containing the list | | Caller must hold the lock on the synchronisation object containing the list | ||
|- | |- | ||
Line 7,829: | Line 7,829: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! List |
| Handle of List entry to put thread into | | Handle of List entry to put thread into | ||
|- | |- | ||
− | ! | + | ! Lock |
| Handle of Lock to release before going into wait state | | Handle of Lock to release before going into wait state | ||
|- | |- | ||
− | ! | + | ! Flags |
| Flag to indicate which unlock method to use | | Flag to indicate which unlock method to use | ||
|- | |- | ||
− | ! | + | ! Timeout |
| Milliseconds to wait before timeout (INFINITE equals wait forever) | | Milliseconds to wait before timeout (INFINITE equals wait forever) | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the lock on the synchronisation object containing the list | | Caller must hold the lock on the synchronisation object containing the list | ||
|- | |- | ||
Line 7,856: | Line 7,856: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! List |
| Handle of List entry to release thread from | | Handle of List entry to release thread from | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the lock on the synchronisation object containing the list | | Caller must hold the lock on the synchronisation object containing the list | ||
|- | |- | ||
Line 7,874: | Line 7,874: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! List |
| Handle of List entry to release thread from | | Handle of List entry to release thread from | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the lock on the synchronisation object containing the list | | Caller must hold the lock on the synchronisation object containing the list | ||
|- | |- | ||
Line 7,892: | Line 7,892: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Thread |
| Handle of the thread to wait on | | Handle of the thread to wait on | ||
|- | |- | ||
− | ! | + | ! Timeout |
| Milliseconds to wait before timeout (0 equals do not wait, INFINITE equals wait forever) | | Milliseconds to wait before timeout (0 equals do not wait, INFINITE equals wait forever) | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| The wait can be abandoned by calling ThreadWake with the handle of the waiting thread | | The wait can be abandoned by calling ThreadWake with the handle of the waiting thread | ||
|- | |- | ||
Line 7,913: | Line 7,913: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Thread |
| Handle of thread to suspend | | Handle of thread to suspend | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| Suspending a thread from another thread is not safe unless specific precautions are taken to prevent deadlocks. It is normally safe for a thread to suspend itself as long as it releases any locks it is holding that may be required by other threads before suspending. | | Suspending a thread from another thread is not safe unless specific precautions are taken to prevent deadlocks. It is normally safe for a thread to suspend itself as long as it releases any locks it is holding that may be required by other threads before suspending. | ||
|- | |- | ||
Line 7,931: | Line 7,931: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Thread |
| Handle of thread to resume | | Handle of thread to resume | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 7,946: | Line 7,946: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| The received message is not removed from the message list | | The received message is not removed from the message list | ||
|- | |- | ||
Line 7,961: | Line 7,961: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Thread |
| Handle of thread to send to | | Handle of thread to send to | ||
|- | |- | ||
− | ! | + | ! Message |
| Contents of message to send | | Contents of message to send | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 7,979: | Line 7,979: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Message |
| The received message if successful, undefined on error | | The received message if successful, undefined on error | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 7,994: | Line 7,994: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Message |
| The received message if successful, undefined on error | | The received message if successful, undefined on error | ||
|- | |- | ||
− | ! | + | ! Timeout |
| Milliseconds to wait before timeout (0 equals do not wait, INFINITE equals wait forever) | | Milliseconds to wait before timeout (0 equals do not wait, INFINITE equals wait forever) | ||
|- | |- | ||
− | ! | + | ! Remove |
| If true then remove the received message from the message list | | If true then remove the received message from the message list | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 8,015: | Line 8,015: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Thread |
| Handle of thread to abandon waiting | | Handle of thread to abandon waiting | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| The waiting thread will return with ERROR_WAIT_ABANDONED or ERROR_WAIT_TIMEOUT | | The waiting thread will return with ERROR_WAIT_ABANDONED or ERROR_WAIT_TIMEOUT | ||
|- | |- | ||
Line 8,033: | Line 8,033: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Thread |
| Handle of thread to lock | | Handle of thread to lock | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| Locking a thread will also disable IRQ or FIQ depending on scheduler settings. The lock should only be held for the briefest time possible. | | Locking a thread will also disable IRQ or FIQ depending on scheduler settings. The lock should only be held for the briefest time possible. | ||
|- | |- | ||
Line 8,051: | Line 8,051: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Thread |
| Handle of thread to unlock | | Handle of thread to unlock | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| Locking a thread will also disable IRQ or FIQ depending on scheduler settings. The lock should only be held for the briefest time possible. | | Locking a thread will also disable IRQ or FIQ depending on scheduler settings. The lock should only be held for the briefest time possible. | ||
|- | |- | ||
Line 8,069: | Line 8,069: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Not intended to be called directly by applications | | Not intended to be called directly by applications | ||
|- | |- | ||
Line 8,084: | Line 8,084: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! CPUID |
| The ID of the current CPU | | The ID of the current CPU | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if either first key is zero, ERROR_NO_MORE_ITEMS if both queues are empty or another error code on failure | | ERROR_SUCCESS if either first key is zero, ERROR_NO_MORE_ITEMS if both queues are empty or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| Called by scheduler interrupt with IRQ or FIQ disabled and running on the IRQ or FIQ thread | | Called by scheduler interrupt with IRQ or FIQ disabled and running on the IRQ or FIQ thread | ||
|- | |- | ||
Line 8,102: | Line 8,102: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! CPUID |
| The ID of the current CPU | | The ID of the current CPU | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| Called by scheduler interrupt with IRQ or FIQ disabled and running on the IRQ or FIQ thread | | Called by scheduler interrupt with IRQ or FIQ disabled and running on the IRQ or FIQ thread | ||
|- | |- | ||
Line 8,120: | Line 8,120: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! CPUID |
| The ID of the current CPU | | The ID of the current CPU | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| Called by scheduler interrupt with IRQ or FIQ disabled and running on the IRQ or FIQ thread | | Called by scheduler interrupt with IRQ or FIQ disabled and running on the IRQ or FIQ thread | ||
|- | |- | ||
Line 8,138: | Line 8,138: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! CPUID |
| The ID of the current CPU | | The ID of the current CPU | ||
|- | |- | ||
− | ! | + | ! Thread |
| The handle of the currently running thread (Before IRQ or FIQ occurred) | | The handle of the currently running thread (Before IRQ or FIQ occurred) | ||
|- | |- | ||
− | ! | + | ! Return |
| The handle of the current thread which may be the old thread or a new thread | | The handle of the current thread which may be the old thread or a new thread | ||
|- | |- | ||
− | ! | + | ! Note |
| Called by scheduler interrupt with IRQ or FIQ disabled and running on the IRQ or FIQ thread | | Called by scheduler interrupt with IRQ or FIQ disabled and running on the IRQ or FIQ thread | ||
|- | |- | ||
Line 8,159: | Line 8,159: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! CPUID |
| The ID of the current CPU | | The ID of the current CPU | ||
|- | |- | ||
− | ! | + | ! Thread |
| The handle of the currently running thread (Before IRQ or FIQ occurred or when Reschedule was called) | | The handle of the currently running thread (Before IRQ or FIQ occurred or when Reschedule was called) | ||
|- | |- | ||
− | ! | + | ! Yield |
| True if the current thread is giving up its remaining time slice | | True if the current thread is giving up its remaining time slice | ||
|- | |- | ||
− | ! | + | ! Return |
| The handle of the next thread to run or INVALID_HANDLE_VALUE on no selection or error | | The handle of the next thread to run or INVALID_HANDLE_VALUE on no selection or error | ||
|- | |- | ||
− | ! | + | ! Note |
| Called either by scheduler interrupt with IRQ or FIQ disabled and running on the IRQ or FIQ thread. Or by scheduler reschedule with IRQ or FIQ disabled and running on the current thread. Caller must either hold a lock on the current thread or have disabled IRQ or FIQ. | | Called either by scheduler interrupt with IRQ or FIQ disabled and running on the IRQ or FIQ thread. Or by scheduler reschedule with IRQ or FIQ disabled and running on the current thread. Caller must either hold a lock on the current thread or have disabled IRQ or FIQ. | ||
|- | |- | ||
Line 8,183: | Line 8,183: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Yield |
| True if the current thread is giving up its remaining time slice | | True if the current thread is giving up its remaining time slice | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| Called by the currently running thread to force a reschedule before sleeping, waiting etc | | Called by the currently running thread to force a reschedule before sleeping, waiting etc | ||
|- | |- | ||
Line 8,201: | Line 8,201: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 8,213: | Line 8,213: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 8,225: | Line 8,225: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! CPUID |
| The ID of the CPU to enable for | | The ID of the CPU to enable for | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 8,240: | Line 8,240: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! CPUID |
| The ID of the CPU to disable for | | The ID of the CPU to disable for | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 8,255: | Line 8,255: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! CPUID |
| The ID of the CPU to enable for | | The ID of the CPU to enable for | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 8,270: | Line 8,270: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! CPUID |
| The ID of the CPU to disable for | | The ID of the CPU to disable for | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 8,288: | Line 8,288: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Return |
| Handle of new Messageslot entry or INVALID_HANDLE_VALUE if entry could not be created | | Handle of new Messageslot entry or INVALID_HANDLE_VALUE if entry could not be created | ||
|- | |- | ||
Line 8,300: | Line 8,300: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Maximum |
| Maximum number of messages allowed for the Messageslot (Must be greater than zero) | | Maximum number of messages allowed for the Messageslot (Must be greater than zero) | ||
|- | |- | ||
− | ! | + | ! Flags |
| The flags for the Messageslot entry (eg MESSAGESLOT_FLAG_IRQ) | | The flags for the Messageslot entry (eg MESSAGESLOT_FLAG_IRQ) | ||
|- | |- | ||
− | ! | + | ! Return |
| Handle of new Messageslot entry or INVALID_HANDLE_VALUE if entry could not be created | | Handle of new Messageslot entry or INVALID_HANDLE_VALUE if entry could not be created | ||
|- | |- | ||
Line 8,318: | Line 8,318: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Messageslot |
| Handle of Messageslot entry to destroy | | Handle of Messageslot entry to destroy | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 8,333: | Line 8,333: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Messageslot |
| Messageslot to get from | | Messageslot to get from | ||
|- | |- | ||
− | ! | + | ! Return |
| Number of messages or INVALID_HANDLE_VALUE on error | | Number of messages or INVALID_HANDLE_VALUE on error | ||
|- | |- | ||
Line 8,348: | Line 8,348: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Messageslot |
| Messageslot to send to | | Messageslot to send to | ||
|- | |- | ||
− | ! | + | ! Message |
| Contents of message to send | | Contents of message to send | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 8,366: | Line 8,366: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Messageslot |
| Messageslot to receive from | | Messageslot to receive from | ||
|- | |- | ||
− | ! | + | ! Message |
| The received message if successful, undefined on error | | The received message if successful, undefined on error | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 8,384: | Line 8,384: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Messageslot |
| Messageslot to receive from | | Messageslot to receive from | ||
|- | |- | ||
− | ! | + | ! Message |
| The received message if successful, undefined on error | | The received message if successful, undefined on error | ||
|- | |- | ||
− | ! | + | ! Timeout |
| Milliseconds to wait before timeout (0 equals do not wait, INFINITE equals wait forever) | | Milliseconds to wait before timeout (0 equals do not wait, INFINITE equals wait forever) | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 8,408: | Line 8,408: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Maximum |
| Maximum number of messages allowed for the Mailslot (Must be greater than zero) | | Maximum number of messages allowed for the Mailslot (Must be greater than zero) | ||
|- | |- | ||
− | ! | + | ! Return |
| Handle of new Mailslot entry or INVALID_HANDLE_VALUE if entry could not be created | | Handle of new Mailslot entry or INVALID_HANDLE_VALUE if entry could not be created | ||
|- | |- | ||
Line 8,423: | Line 8,423: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Mailslot |
| Handle of Mailslot entry to destroy | | Handle of Mailslot entry to destroy | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 8,438: | Line 8,438: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Mailslot |
| Mailslot to get from | | Mailslot to get from | ||
|- | |- | ||
− | ! | + | ! Return |
| Number of messages or INVALID_HANDLE_VALUE on error | | Number of messages or INVALID_HANDLE_VALUE on error | ||
|- | |- | ||
Line 8,453: | Line 8,453: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Mailslot |
| Mailslot to send to | | Mailslot to send to | ||
|- | |- | ||
− | ! | + | ! Data |
| Message to send to mailslot | | Message to send to mailslot | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 8,471: | Line 8,471: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Mailslot |
| Mailslot to send to | | Mailslot to send to | ||
|- | |- | ||
− | ! | + | ! Data |
| Message to send to mailslot | | Message to send to mailslot | ||
|- | |- | ||
− | ! | + | ! Timeout |
| Milliseconds to wait before timeout (0 equals do not wait, INFINITE equals wait forever) | | Milliseconds to wait before timeout (0 equals do not wait, INFINITE equals wait forever) | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 8,492: | Line 8,492: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Mailslot |
| Mailslot to receive from | | Mailslot to receive from | ||
|- | |- | ||
− | ! | + | ! Return |
| Received message or INVALID_HANDLE_VALUE on error | | Received message or INVALID_HANDLE_VALUE on error | ||
|- | |- | ||
Line 8,507: | Line 8,507: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Timeout |
| Timeout = 0 then No Wait, Timeout = INFINITE then Wait forever | | Timeout = 0 then No Wait, Timeout = INFINITE then Wait forever | ||
|- | |- | ||
Line 8,521: | Line 8,521: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 8,533: | Line 8,533: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 8,545: | Line 8,545: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 8,557: | Line 8,557: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 8,569: | Line 8,569: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 8,581: | Line 8,581: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 8,593: | Line 8,593: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Timeout |
| Timeout = 0 then No Wait, Timeout = INFINITE then Wait forever | | Timeout = 0 then No Wait, Timeout = INFINITE then Wait forever | ||
|- | |- | ||
Line 8,605: | Line 8,605: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 8,617: | Line 8,617: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 8,632: | Line 8,632: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 8,644: | Line 8,644: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 8,656: | Line 8,656: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 8,668: | Line 8,668: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 8,680: | Line 8,680: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 8,692: | Line 8,692: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Event |
| Event to wait on | | Event to wait on | ||
|- | |- | ||
− | ! | + | ! Timeout |
| Time in milliseconds to wait for the event to be signaled | | Time in milliseconds to wait for the event to be signaled | ||
0 = No Wait | 0 = No Wait | ||
<br />INFINITE = Wait Indefinitely | <br />INFINITE = Wait Indefinitely | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 8,712: | Line 8,712: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 8,724: | Line 8,724: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 8,736: | Line 8,736: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 8,751: | Line 8,751: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 8,763: | Line 8,763: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 8,775: | Line 8,775: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 8,787: | Line 8,787: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 8,799: | Line 8,799: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 8,811: | Line 8,811: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 8,823: | Line 8,823: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 8,835: | Line 8,835: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 8,847: | Line 8,847: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 8,859: | Line 8,859: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 8,871: | Line 8,871: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 8,883: | Line 8,883: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 8,895: | Line 8,895: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 8,907: | Line 8,907: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 8,919: | Line 8,919: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 8,934: | Line 8,934: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 8,946: | Line 8,946: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 8,958: | Line 8,958: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 8,970: | Line 8,970: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 8,982: | Line 8,982: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 8,994: | Line 8,994: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,006: | Line 9,006: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,018: | Line 9,018: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,030: | Line 9,030: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,042: | Line 9,042: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,054: | Line 9,054: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,066: | Line 9,066: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Not intended to be called directly by applications | | Not intended to be called directly by applications | ||
|- | |- | ||
Line 9,081: | Line 9,081: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,093: | Line 9,093: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,105: | Line 9,105: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,117: | Line 9,117: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 9,129: | Line 9,129: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Return |
| Dequeued Task or nil on failure (or list empty) | | Dequeued Task or nil on failure (or list empty) | ||
|- | |- | ||
Line 9,141: | Line 9,141: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if the list contains tasks, ERROR_NO_MORE_ITEMS if list is empty or another error code on failure | | ERROR_SUCCESS if the list contains tasks, ERROR_NO_MORE_ITEMS if list is empty or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| Called by clock interrupt with IRQ or FIQ disabled and running on the IRQ or FIQ thread | | Called by clock interrupt with IRQ or FIQ disabled and running on the IRQ or FIQ thread | ||
|- | |- | ||
Line 9,156: | Line 9,156: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| Called by clock interrupt with IRQ or FIQ disabled and running on the IRQ or FIQ thread | | Called by clock interrupt with IRQ or FIQ disabled and running on the IRQ or FIQ thread | ||
|- | |- | ||
Line 9,171: | Line 9,171: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,177: | Line 9,177: | ||
</div></div> | </div></div> | ||
<br /> | <br /> | ||
+ | |||
'''RTL initialize and exit functions''' | '''RTL initialize and exit functions''' | ||
Line 9,185: | Line 9,186: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,197: | Line 9,198: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,209: | Line 9,210: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,224: | Line 9,225: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,239: | Line 9,240: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,251: | Line 9,252: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,263: | Line 9,264: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,275: | Line 9,276: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,287: | Line 9,288: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,299: | Line 9,300: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,311: | Line 9,312: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,323: | Line 9,324: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,335: | Line 9,336: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,347: | Line 9,348: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Timeout |
| 0=No Timeout | | 0=No Timeout | ||
|- | |- | ||
Line 9,359: | Line 9,360: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| -15..+15, 0=Normal | | -15..+15, 0=Normal | ||
|- | |- | ||
Line 9,371: | Line 9,372: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,383: | Line 9,384: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,395: | Line 9,396: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,407: | Line 9,408: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,419: | Line 9,420: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,431: | Line 9,432: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,443: | Line 9,444: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,455: | Line 9,456: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,467: | Line 9,468: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,479: | Line 9,480: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,491: | Line 9,492: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,503: | Line 9,504: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,515: | Line 9,516: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,527: | Line 9,528: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,539: | Line 9,540: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,551: | Line 9,552: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Timeout |
| 0=No Timeout | | 0=No Timeout | ||
|- | |- | ||
Line 9,563: | Line 9,564: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,575: | Line 9,576: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,587: | Line 9,588: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,599: | Line 9,600: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,611: | Line 9,612: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,623: | Line 9,624: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Timeout |
| 0=No Timeout | | 0=No Timeout | ||
|- | |- | ||
Line 9,635: | Line 9,636: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,647: | Line 9,648: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,659: | Line 9,660: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,671: | Line 9,672: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,686: | Line 9,687: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,698: | Line 9,699: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,710: | Line 9,711: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,722: | Line 9,723: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,734: | Line 9,735: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,746: | Line 9,747: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,758: | Line 9,759: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,770: | Line 9,771: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,782: | Line 9,783: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,794: | Line 9,795: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,806: | Line 9,807: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,818: | Line 9,819: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,830: | Line 9,831: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,842: | Line 9,843: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,854: | Line 9,855: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,866: | Line 9,867: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,878: | Line 9,879: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,890: | Line 9,891: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,902: | Line 9,903: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,914: | Line 9,915: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,926: | Line 9,927: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,938: | Line 9,939: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,950: | Line 9,951: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,962: | Line 9,963: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,974: | Line 9,975: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,986: | Line 9,987: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 9,998: | Line 9,999: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 10,010: | Line 10,011: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 10,022: | Line 10,023: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 10,034: | Line 10,035: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 10,046: | Line 10,047: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 10,058: | Line 10,059: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 10,070: | Line 10,071: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 10,082: | Line 10,083: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 10,097: | Line 10,098: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 10,109: | Line 10,110: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 10,121: | Line 10,122: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 10,133: | Line 10,134: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 10,145: | Line 10,146: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 10,157: | Line 10,158: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 10,169: | Line 10,170: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 10,181: | Line 10,182: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 10,193: | Line 10,194: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 10,205: | Line 10,206: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 10,217: | Line 10,218: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 10,229: | Line 10,230: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 10,241: | Line 10,242: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 10,253: | Line 10,254: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 10,265: | Line 10,266: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 10,277: | Line 10,278: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 10,289: | Line 10,290: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 10,301: | Line 10,302: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 10,313: | Line 10,314: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 10,328: | Line 10,329: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 10,340: | Line 10,341: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 10,355: | Line 10,356: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- |
Revision as of 05:22, 15 April 2018
Return to Unit Reference
Contents
[hide]Description
Ultibo Threads interface unit
Locking Primitives
Spin -
A simple spin lock for fast mutually exclusive access to data. Threads "spin" while waiting to acquire the lock and do not yield the CPU unless pre-empted.
Non recursive (can only be acquired once by the same thread)
Includes IRQ/FIQ entry and exit routines to Save/Restore the IRQ/FIQ state.
Suitable for use by Interrupt handlers if non interrupt callers use the IRQ/FIQ entry and exit routines to Lock and Unlock.
Suitable for use on multiprocessor systems if the lock is allocated from shared memory (Determined during initialization).
Not recommended for long held operations or holding during I/O operations.
Access is not serialized, the next thread to try obtaining the lock when it is released will succeed even if that thread was not the first waiting.
Usage:
Create/Destroy
Spin locks are created using SpinCreate() and destroyed using SpinDestroy(), these functions should not be called from within an Interrupt handler. Lock/Unlock (Data accessed only by threads)
To synchronize data access between threads each thread should call SpinLock() before accessing the data and SpinUnlock() when finished accessing the data. These calls do not affect the state of IRQs or FIQs and therefore do not impact interrupt latency. Lock/Unlock (Data accessed by threads and interrupt handlers)
To use a Spin lock to synchronize data access between threads and an interrupt handler each thread should call SpinLockIRQ() or SpinLockFIQ(), depending on whether the interrupt handler is servicing IRQ or FIQ requests, before accessing the data and SpinUnlockIRQ() or SpinUnlockFIQ() when finished accessing the data. These calls disable interrupts before acquiring the lock (with deadlock protection) and restore interrupts after releasing the lock and therefore should only be used to protect very short sections of code accessing shared data to minimize the impact on interrupt latency.
Interrupt handlers should call SpinLock() before accessing the data and SpinUnlock() when finished accessing the data. In a Uniprocessor system it is technically not necessary for interrupt handlers to call lock/unlock as the use of IRQ/FIQ disable/enable will prevent interrupt handlers from executing while a thread has the lock. On a Multiprocessor system however interrupt handlers can execute on one processor while a thread is executing on another (which will not deadlock), to correctly synchronize data access both threads and interrupt handlers should call the appropriate lock/unlock before and after access to the data.
Lock Hierarchy -
It is safe to acquire one lock using SpinLock() then another lock using SpinLock() and then release them in reverse order.
It is also safe to acquire one lock using SpinLock() then another lock using SpinLockIRQ(or FIQ)() and then release them in reverse order.
It is NOT safe to acquire one lock using SpinLockIRQ(or FIQ)() then another lock using SpinLock() and then release them in reverse order. This is because the first SpinLockIRQ(or FIQ)() can disable the scheduling and prevent thread preemption. If another thread is already holding the second lock then this sequence will deadlock (except on a multicore system where the other thread is running on a different CPU).
It is also safe to acquire one lock using SpinLockIRQ(or FIQ)() then another lock using SpinLockIRQ(or FIQ)() and then release them in reverse order. In this case you must ensure that any thread acquiring the second lock also calls SpinLockIRQ(or FIQ)() to thereby avoid the deadlock.
It is NOT safe to acquire one lock using SpinLockIRQ(or FIQ)() then another lock using SpinLockIRQ(or FIQ)() and then release them in the SAME order. If the situation absolutely requires this behaviour then you must use SpinExchangeIRQ(or FIQ)() when holding both locks in order to reverse the order of the IRQ or FIQ re-enabling.
Mutex -
A mutually exclusive lock for controlling access to data. Threads yield while waiting to acquire the lock.
Non recursive (can only be acquired once by the same thread) (Recursive if MUTEX_FLAG_RECURSIVE specified)
Not suitable for use by Interrupt handlers.
Suitable for use on multiprocessor systems if the lock is allocated from shared memory (Determined during initialization).
Recommended for long held operations or holding during I/O operations.
Access is not serialized, the next thread to try obtaining the lock when it is released will succeed even if that thread was not the first waiting.
CriticalSection -
A mutually exclusive lock for serializing access to data. Threads are placed on a wait list while waiting to acquire the lock.
Recursive (can be acquired multiple times by the same thread)
Not suitable for use by Interrupt handlers.
Suitable for use on multiprocessor systems.
Recommended for long held operations or holding during I/O operations.
Access is serialized, the next thread to obtain the lock when it is released will be the thread that has been waiting longest (See also stolen wakeups below).
Semaphore -
Suitable for use by Interrupt handlers for signaling only if created with SEMAPHORE_FLAG_IRQ or FIQ (Interrupt handlers must not call wait).
Suitable for use on multiprocessor systems.
Access is serialized, the next thread to acquire the semaphore when it is signaled will be the thread that has been waiting longest (See also stolen wakeups below).
Synchronizer -
A reader/writer lock for serializing multiple concurrent reads and single writes to data. Threads are placed on a wait list while waiting to acquire the lock.
Recursive (reader lock can be acquired multiple times by the same thread or by other threads/writer lock can be acquired multiple times by the same thread).
Not suitable for use by Interrupt handlers.
Suitable for use on multiprocessor systems.
Recommended for long held operations or holding during I/O operations.
Access is serialized, the next thread to obtain the lock when it is released will be the thread that has been waiting longest (See also stolen wakeups below).
Condition -
A condition variable for coordinating synchronized access to resources by multiple threads. Condition variables are similar in concept to both Semaphores and Events but do not retain any internal state information so threads always wait until they are woken or the specified timeout interval expires.
Not suitable for use by Interrupt handlers.
Suitable for use on multiprocessor systems.
Access is serialized, the next thread released when a condition is woken will be the thread that has been waiting longest (See also stolen wakeups below).
Completion -
A completion is similar in concept to both condition variables and events but behaves differently to each of them. Completions are designed to be similar to the Linux synchronization object of the same name and provide a light weight mechanism for allowing one or more threads to wait for a signal that they can proceed. The completion differs from a condition variable because it maintains an internal state, once the state has been set (complete) threads pass through the completion without waiting (until the state is reset). This is similar to an event (see below) but in the case of a completion the state remains set indefinitely or until reset is called, a completion also allows explicitly releasing one thread at a time or all threads at once. More generally the event was created to model a behaviour that is similar to the same object in Windows and the completion models the Linux object instead.
Completions can use a counted state rather than a single state if they are created with COMPLETION_FLAG_COUNTED, this is to mimic the implementation of the Linux variation however there is a slight but important change in the way counted completions are implemented in Ultibo. The Linux completion sets the count to UMAX_INT / 2 on complete_all() which is documented as "effectively infinite". This is of course incorrect and seriously flawed because the count value is only set to a little over 2 billion, a long running application could easily consume this count with calls to wait_for_completion() and then the application would potentially fail without explanation.
To prevent this same fatal flaw the Ultibo implementation sets the count at LongWord(-1) on CompletionCompleteAll() and all other operations check for this value before incrementing or decrementing the count further. In this way the setting of complete all is genuinely infinite and will not fail on a long running application.
Suitable for use by Interrupt handlers to call complete only if created with COMPLETION_FLAG_IRQ or FIQ (Interrupt handlers must not call wait).
Suitable for use on multiprocessor systems.
Access is serialized, the next thread released when a completion is set will be the thread that has been waiting longest (See also stolen wakeups below).
Stolen wakeups:
Locking and synchronization types such as CriticalSection, Semaphore, Condition, Event, Messageslot and Mailslot use a wait queue internally to determine which thread has been waiting the longest. When a thread is removed from the wait queue so it can obtain the lock, semaphore, event etc there is a small window where the lock, semaphore or event may be acquired by another thread before the thread that was just woken from the wait queue. This is called a stolen wakeup and can happen in many systems including Windows and Linux, in some systems the caller is expected to check the state of a predicate value on return in order to detect a stolen wakeup. In Ultibo the code within the lock, semaphore, event etc functions automatically checks for a stolen wakeup and takes appropriate action to either return the thread to the wait queue or return with a timeout (where appropriate) so that the caller can respond accordingly.
In no case will a call to a locking or synchronization function fail due to a stolen wakeup, the worst case scenario is that a thread may wait longer than it should have (ie it is returned to the back of the queue) or it may return with a timeout before the specified timeout value has expired.
Constants
LOCK_FLAG_*
SPIN_SIGNATURE_*
SPIN_STATE_*
MUTEX_SIGNATURE_*
MUTEX_STATE_*
MUTEX_FLAG_*
CRITICAL_SECTION_SIGNATURE_*
CRITICAL_SECTION_STATE_*
SEMAPHORE_SIGNATURE_*
SEMAPHORE_FLAG_*
SYNCHRONIZER_SIGNATURE_*
SYNCHRONIZER_STATE_*
SYNCHRONIZER_FLAG_*
CONDITION_*
CONDITION_FLAG_*
CONDITION_LOCK_FLAG_*
COMPLETION_*
COMPLETION_STATE_*
COMPLETION_FLAG_*
LIST_SIGNATURE_*
LIST_TYPE_*
LIST_FLAG_*
QUEUE_SIGNATURE_*
QUEUE_TYPE_*
QUEUE_FLAG_*
QUEUE_KEY_*
THREAD_SIGNATURE_*
THREAD_TYPE_*
THREAD_FLAG_*
THREAD_STATE_*
THREAD_PRIORITY_*
THREAD_NAME_*
*_THREAD_PRIORITY
THREAD_CREATE_*
THREAD_TLS_*
THREAD_TLS_FLAG_*
THREAD_LISTS_*
MESSAGESLOT_SIGNATURE_*
MESSAGESLOT_FLAG_*
MAILSLOT_SIGNATURE_*
BUFFER_SIGNATURE_*
BUFFER_FLAG_*
EVENT_SIGNATURE_*
EVENT_STATE_*
EVENT_FLAG_*
TIMER_SIGNATURE_*
TIMER_STATE_*
TIMER_FLAG_*
TIMER_KEY_*
WORKER_SIGNATURE_*
WORKER_FLAG_*
TASKER_TASK_*
SCHEDULER_MIGRATION_*
SCHEDULER_PREEMPT_*
SCHEDULER_ALLOCATION_*
SCHEDULER_MASK_*
SCHEDULER_QUANTUM_*
THREAD_LOG_*
Type definitions
Spin entry
Mutex entry
Critical section entry
Semaphore entry
Synchronizer entry
Condition entry
Completion entry
List entry
List element
List handles
PListHandles = ^TListHandles;
TListHandles = array[0..THREAD_LISTS_MAXIMUM - 1] of TListHandle;
Queue entry
Queue element
Message list
Message
Thread entry
Thread snapshot
Messageslot entry
Mailslot entry
Buffer entry
Buffer item
Event entry
Timer list
Timer item
Timer entry
Worker request
Tasker list
Tasker task
Tasker thread send message
Tasker messageslot send
Tasker semaphore signal
Thread info
CPU start
TCPUStart = procedure(CPUID:LongWord);
|
Primary initialization
TPrimaryInit = procedure;
|
Scheduler initialization
TSchedulerInit = procedure;
|
Scheduler start
TSchedulerStart = procedure(CPUID:LongWord);
|
Secondary initialization
TSecondaryInit = procedure;
|
Secondary boot
TSecondaryBoot = procedure(CPUID:LongWord);
|
Spin lock
TSpinLock = function(Spin:PSpinEntry):LongWord;
|
Spin unlock
TSpinUnlock = function(Spin:PSpinEntry):LongWord;
|
Spin lock IRQ
TSpinLockIRQ = function(Spin:PSpinEntry):LongWord;
|
Spin unlock IRQ
TSpinUnlockIRQ = function(Spin:PSpinEntry):LongWord;
|
Spin lock FIQ
TSpinLockFIQ = function(Spin:PSpinEntry):LongWord;
|
Spin unlock FIQ
TSpinUnlockFIQ = function(Spin:PSpinEntry):LongWord;
|
Spin lock IRQ/FIQ
TSpinLockIRQFIQ = function(Spin:PSpinEntry):LongWord;
|
Spin unlock IRQ/FIQ
TSpinUnlockIRQFIQ = function(Spin:PSpinEntry):LongWord;
|
Spin check IRQ
TSpinCheckIRQ = function(Spin:PSpinEntry):Boolean;
|
Spin check FIQ
TSpinCheckFIQ = function(Spin:PSpinEntry):Boolean;
|
Spin exchange IRQ
TSpinExchangeIRQ = function(Spin1,Spin2:PSpinEntry):LongWord;
|
Spin exchange FIQ
TSpinExchangeFIQ = function(Spin1,Spin2:PSpinEntry):LongWord;
|
Spin mask exchange
TSpinMaskExchange = function(Spin1,Spin2:PSpinEntry):LongWord;
|
Mutex lock
TMutexLock = function(Mutex:PMutexEntry):LongWord;
|
Mutex unlock
TMutexUnlock = function(Mutex:PMutexEntry):LongWord;
|
Mutex try lock
TMutexTryLock = function(Mutex:PMutexEntry):LongWord;
|
Critical section lock
TCriticalSectionLock = function(CriticalSection:PCriticalSectionEntry):LongWord;
|
Critical section lock ex
TCriticalSectionLockEx = function(CriticalSection:PCriticalSectionEntry; Timeout:LongWord):LongWord;
|
Critical section unlock
TCriticalSectionUnlock = function(CriticalSection:PCriticalSectionEntry):LongWord;
|
Critical section try lock
TCriticalSectionTryLock = function(CriticalSection:PCriticalSectionEntry):LongWord;
|
Semaphore wait
TSemaphoreWait = function(Semaphore:PSemaphoreEntry):LongWord;
|
Semaphore wait ex
TSemaphoreWaitEx = function(Semaphore:PSemaphoreEntry; Timeout:LongWord):LongWord;
|
Semaphore signal
TSemaphoreSignal = function(Semaphore:PSemaphoreEntry):LongWord;
|
Synchronizer lock
TSynchronizerLock = function(Synchronizer:PSynchronizerEntry):LongWord;
|
Synchronizer lock ex
TSynchronizerLockEx = function(Synchronizer:PSynchronizerEntry; Timeout:LongWord):LongWord;
|
Synchronizer unlock
TSynchronizerUnlock = function(Synchronizer:PSynchronizerEntry):LongWord;
|
Synchronizer convert
TSynchronizerConvert = function(Synchronizer:PSynchronizerEntry):LongWord;
|
Synchronizer convert ex
TSynchronizerConvertEx = function(Synchronizer:PSynchronizerEntry; Timeout:LongWord):LongWord;
|
Condition wait
TConditionWait = function(Condition:PConditionEntry; Timeout:LongWord):LongWord;
|
Condition wait mutex
TConditionWaitMutex = function(Condition:PConditionEntry; Mutex:TMutexHandle; Timeout:LongWord):LongWord;
|
Condition wait synchronizer
TConditionWaitSynchronizer = function(Condition:PConditionEntry; Synchronizer:TSynchronizerHandle; Flags,Timeout:LongWord):LongWord;
|
Condition wait critical section
TConditionWaitCriticalSection = function(Condition:PConditionEntry; CriticalSection:TCriticalSectionHandle; Timeout:LongWord):LongWord;
|
Condition wake
TConditionWake = function(Condition:PConditionEntry):LongWord;
|
Condition wake all
TConditionWakeAll = function(Condition:PConditionEntry):LongWord;
|
Completion wait
TCompletionWait = function(Completion:PCompletionEntry; Timeout:LongWord):LongWord;
|
Completion try wait
TCompletionTryWait = function(Completion:PCompletionEntry):LongWord;
|
Completion reset
TCompletionReset = function(Completion:PCompletionEntry):LongWord;
|
Completion complete
TCompletionComplete = function(Completion:PCompletionEntry):LongWord;
|
Completion complete all
TCompletionCompleteAll = function(Completion:PCompletionEntry):LongWord;
|
Messageslot send
TMessageslotSend = function(Messageslot:PMessageslotEntry; Message:PMessage):LongWord;
|
Messageslot receive
TMessageslotReceive = function(Messageslot:PMessageslotEntry; Message:PMessage):LongWord;
|
Messageslot receive ex
TMessageslotReceiveEx = function(Messageslot:PMessageslotEntry; Message:PMessage; Timeout:LongWord):LongWord;
|
Mailslot send
TMailslotSend = function(Mailslot:PMailslotEntry; Data:Integer):LongWord;
|
Mailslot send ex
TMailslotSendEx = function(Mailslot:PMailslotEntry; Data:Integer; Timeout:LongWord):LongWord;
|
Mailslot receive
TMailslotReceive = function(Mailslot:PMailslotEntry):Integer;
|
Mailslot receive ex
TMailslotReceiveEx = function(Mailslot:PMailslotEntry; Timeout:LongWord):Integer;
|
Buffer get
TBufferGet = function(Buffer:PBufferEntry):Pointer;
|
Buffer get ex
TBufferGetEx = function(Buffer:PBufferEntry; Timeout:LongWord):Pointer;
|
Buffer free
TBufferFree = function(Buffer:Pointer):LongWord;
|
Buffer iterate
TBufferIterate = function(Buffer:PBufferEntry; Previous:Pointer):Pointer;
|
Event wait
TEventWait = function(Event:PEventEntry):LongWord;
|
Event wait ex
TEventWaitEx = function(Event:PEventEntry; Timeout:LongWord):LongWord;
|
Event set
TEventSet = function(Event:PEventEntry):LongWord;
|
Event reset
TEventReset = function(Event:PEventEntry):LongWord;
|
Event pulse
TEventPulse = function(Event:PEventEntry):LongWord;
|
Timer enable
TTimerEnable = function(Timer:PTimerEntry):LongWord;
|
Timer enable ex
TTimerEnableEx = function(Timer:PTimerEntry; Interval:LongWord; Event:TTimerEvent; Data:Pointer):LongWord;
|
Timer disable
TTimerDisable = function(Timer:PTimerEntry):LongWord;
|
Timer check
TTimerCheck = function:LongWord;
|
Timer trigger
TTimerTrigger = function:LongWord;
|
Tasker check
TTaskerCheck = function:LongWord;
|
Tasker trigger
TTaskerTrigger = function:LongWord;
|
Thread get current
TThreadGetCurrent = function:TThreadHandle;
|
Thread set current
TThreadSetCurrent = function(Thread:TThreadHandle):LongWord;
|
Thread start
TThreadStart = function(Parameter:Pointer):PtrInt;
|
Thread end
TThreadEnd = procedure(ExitCode:LongWord);
|
Scheduler check
TSchedulerCheck = function(CPUID:LongWord):LongWord;
|
Scheduler wakeup
TSchedulerWakeup = function(CPUID:LongWord):LongWord;
|
Scheduler expire
TSchedulerExpire = function(CPUID:LongWord):LongWord;
|
Scheduler switch
TSchedulerSwitch = function(CPUID:LongWord; Thread:TThreadHandle):TThreadHandle;
|
Scheduler select
TSchedulerSelect = function(CPUID:LongWord; Thread:TThreadHandle; Yield:Boolean):TThreadHandle;
|
Scheduler reschedule
TSchedulerReschedule = function (Yield:Boolean):LongWord;
|
Scheduler migration enable
TSchedulerMigrationEnable = function:LongWord;
|
Scheduler migration disable
TSchedulerMigrationDisable = function:LongWord;
|
Scheduler preempt enable
TSchedulerPreemptEnable = function(CPUID:LongWord):LongWord;
|
Scheduler preempt disable
TSchedulerPreemptDisable = function(CPUID:LongWord):LongWord;
|
Scheduler allocation enable
TSchedulerAllocationEnable = function(CPUID:LongWord):LongWord;
|
Scheduler allocation disable
TSchedulerAllocationDisable = function(CPUID:LongWord):LongWord;
|
Thread setup stack
TThreadSetupStack = function(StackBase:Pointer; StartProc:TThreadStart; ReturnProc:TThreadEnd; Parameter:Pointer):Pointer;
|
Public variables
Thread logging
THREAD_DEFAULT_LOG_LEVEL:LongWord = THREAD_LOG_LEVEL_DEBUG;
|
Minimum level for Thread messages. Only messages with level greater than or equal to this will be printed. |
THREAD_LOG_ENABLED:Boolean;
|
Scheduler variables
SchedulerThreadNext:LongWord;
|
The CPU to assign the next created thread to, round robin incremented on each create (Protected by ThreadTableLock) |
SchedulerThreadMigration:LongWord;
|
Enable or Disable thread migration (SCHEDULER_MIGRATION_DISABLED or SCHEDULER_MIGRATION_ENABLED |
SchedulerMigrationQuantum:LongWord;
|
Quantum for thread migration checks (CPU 0 only) |
SchedulerThreadCount:array of LongWord;
|
Current number of ready threads per CPU (One per CPU, allocated by scheduler initialization) (Protected by InterlockedIncrement/Decrement) |
SchedulerThreadQuantum:array of LongWord;
|
Quantum of current thread per CPU (One per CPU, allocated by scheduler initialization) |
SchedulerThreadPreempt:array of LongWord;
|
Current state of thread preemption per CPU (eg SCHEDULER_PREEMPT_DISABLED) (One per CPU, allocated by scheduler initialization) |
SchedulerThreadAllocation:array of LongWord;
|
Current state of thread allocation per CPU (eg SCHEDULER_ALLOCATION_DISABLED) (One per CPU, allocated by scheduler initialization) |
SchedulerPriorityMask:array of LongWord;
|
Mask of ready threads at each priority level (One per CPU, allocated by scheduler initialization) (Protected by InterlockedOr/And) |
SchedulerYieldCurrent:array of LongBool;
|
Scheduler yield to current priority level status (One per CPU, allocated by scheduler initialization) |
SchedulerStarvationNext:array of LongWord;
|
Scheduler starvation priority round robin (One per CPU, allocated by scheduler initialization) |
SchedulerStarvationQuantum:array of LongWord;
|
Quantum for thread starvation checks per CPU (One per CPU, allocated by scheduler initialization) |
SchedulerNoneQueue:array of TQueueHandle;
|
Queue of threads that are ready to run at priority level none (One per CPU, allocated by scheduler initialization) |
SchedulerIdleQueue:array of TQueueHandle;
|
Queue of threads that are ready to run at priority level idle (One per CPU, allocated by scheduler initialization) |
SchedulerLowestQueue:array of TQueueHandle;
|
Queue of threads that are ready to run at priority level lowest (One per CPU, allocated by scheduler initialization) |
SchedulerLowerQueue:array of TQueueHandle;
|
Queue of threads that are ready to run at priority level lower (One per CPU, allocated by scheduler initialization) |
SchedulerNormalQueue:array of TQueueHandle;
|
Queue of threads that are ready to run at priority level normal (One per CPU, allocated by scheduler initialization) |
SchedulerHigherQueue:array of TQueueHandle;
|
Queue of threads that are ready to run at priority level higher (One per CPU, allocated by scheduler initialization) |
SchedulerHighestQueue:array of TQueueHandle;
|
Queue of threads that are ready to run at priority level highest (One per CPU, allocated by scheduler initialization) |
SchedulerCriticalQueue:array of TQueueHandle;
|
Queue of threads that are ready to run at priority level critical (One per CPU, allocated by scheduler initialization) |
SchedulerSleepQueue:array of TQueueHandle;
|
Queue of threads that are currently sleeping (One per CPU, allocated by scheduler initialization) |
SchedulerTimeoutQueue:array of TQueueHandle;
|
Queue of threads that are currently waiting with a timeout (One per CPU, allocated by scheduler initialization) |
SchedulerTerminationQueue:array of TQueueHandle;
|
Queue of threads that have been terminated (One per CPU, allocated by scheduler initialization) |
SchedulerLast:array of LongWord;
|
The timer value of the last scheduler interrupt (One per CPU, allocated by scheduler initialization) |
SchedulerInterrupts:array of LongWord;
|
Current number of scheduler interrupts per CPU (When this reaches SCHEDULER_INTERRUPTS_PER_SECOND then UtilizationLast is updated and UtilizationCurrent is reset) (One per CPU, allocated by scheduler initialization) |
Scheduler debug
SchedulerInterruptCounter:array of Int64;
|
SchedulerInterruptOffset:array of LongWord;
|
SchedulerInterruptMinOffset:array of LongWord;
|
SchedulerInterruptMaxOffset:array of LongWord;
|
SchedulerInterruptRollover:array of LongWord;
|
SchedulerSelectEntry:array of Int64;
|
Number of times the scheduler select routine has been called (One per CPU) |
SchedulerSelectYield:array of Int64;
|
Number of times the scheduler select routine has been called with yield equal to true (One per CPU) |
SchedulerSelectForce:array of Int64;
|
Number of times the scheduler forced a thread switch due to starvation quantum (One per CPU) |
SchedulerSelectNoMask:array of Int64;
|
Number of times the scheduler selection encountered an empty priority mask (Should never happen)(One per CPU) |
SchedulerSelectNormal:array of Int64;
|
Number of times the scheduler selection used normal next highest priority to select thread (One per CPU) |
SchedulerSelectInvalid:array of Int64;
|
Number of times the scheduler selection resulted in INVALID_THREAD_HANDLE (Should never happen)(One per CPU) |
SchedulerSelectFailure:array of Int64;
|
Number of times the scheduler failed to enqueue the currently running thread (Should never happen)(One per CPU) |
SchedulerSelectNoReady:array of Int64;
|
Number of times the scheduler selection found no ready thread available to run (Should never happen)(One per CPU) |
SchedulerSelectDefaulted:array of Int64;
|
Number of times the scheduler selection defaulted to an IDLE or NONE thread (Should never happen)(One per CPU) |
SchedulerStarvationReset:array of Int64;
|
Number of times the scheduler reset the starvation quantum (One per CPU) |
SchedulerStarvationDecrement:array of Int64;
|
Number of times the scheduler decremented the starvation quantum (One per CPU) |
SchedulerSelectCPU:array of Int64;
|
Number of times the scheduler selection changed the CurrentCPU on a running thread (One per CPU) |
SchedulerSelectPriority:array of Int64;
|
Number of times the scheduler selection changed the Priority on a running thread (One per CPU) |
SchedulerSelectAffinity:array of Int64;
|
Number of times the scheduler selection changed the CurrentCPU on a running thread due to Affinity mismatch (One per CPU) |
SchedulerSwitchEntry:array of Int64;
|
Number of times the scheduler switch routine has been called (One per CPU) |
SchedulerSwitchThread:array of TThreadHandle;
|
The thread returned by scheduler select on the last scheduler switch call (One per CPU) |
SchedulerSwitchCounter:array of Int64;
|
Number of times the scheduler switch resulted in a thread switch (One per CPU) |
SchedulerSwitchCurrent:array of Int64;
|
Number of times the scheduler switch resulted in the current thread continuing (One per CPU) |
SchedulerSwitchInvalid:array of Int64;
|
Number of times the scheduler switch was returned INVALID_THREAD_HANDLE by scheduler select (Should never happen)(One per CPU) |
SchedulerRescheduleEntry:array of Int64;
|
Number of times the scheduler reschedule routine has been called (One per CPU) |
SchedulerRescheduleThread:array of TThreadHandle;
|
The thread returned by scheduler select on the last scheduler reschedule call (One per CPU) |
SchedulerRescheduleCounter:array of Int64;
|
Number of times the scheduler reschedule resulted in a thread switch (One per CPU) |
SchedulerRescheduleCurrent:array of Int64;
|
Number of times the scheduler reschedule resulted in the current thread continuing (One per CPU) |
SchedulerRescheduleInvalid:array of Int64;
|
Number of times the scheduler reschedule was returned INVALID_THREAD_HANDLE by scheduler select (Should never happen)(One per CPU) |
SchedulerMigrationCounter:Int64;
|
Number of times scheduler select invoked a thread migration (CPU 0 only) |
SchedulerTerminationCounter:array of Int64;
|
Number of threads destroyed by scheduler reschedule (After termination quantum)(One per CPU) |
SchedulerSecondaryWaitCounter:array of Int64;
|
Number of wait cycles performed by secondary CPUs while waiting for init completion (One per CPU) |
Lock debug
SpinDeadlockCounter:Int64;
|
SpinRecursionCounter:Int64;
|
SpinRecursionThread:TThreadHandle;
|
SpinIRQThreadCounter:Int64;
|
SpinFIQThreadCounter:Int64;
|
SpinSWIThreadCounter:Int64;
|
SpinIdleThreadCounter:Int64;
|
MutexDeadlockCounter:Int64;
|
MutexRecursionCounter:Int64;
|
MutexRecursionThread:TThreadHandle;
|
MutexIRQThreadCounter:Int64;
|
MutexFIQThreadCounter:Int64;
|
MutexSWIThreadCounter:Int64;
|
MutexIdleThreadCounter:Int64;
|
CriticalSectionDeadlockCounter:Int64;
|
SemaphoreDeadlockCounter:Int64;
|
SynchronizerDeadlockCounter:Int64;
|
SynchronizerRecursionCounter:Int64;
|
ConditionDeadlockCounter:Int64;
|
CompletionDeadlockCounter:Int64;
|
MessageslotDeadlockCounter:Int64;
|
MailslotDeadlockCounter:Int64;
|
BufferDeadlockCounter:Int64;
|
EventDeadlockCounter:Int64;
|
Spin debug
SpinLockEntry:LongWord;
|
SpinUnlockEntry:LongWord;
|
SpinLockExit:LongWord;
|
SpinUnlockExit:LongWord;
|
SpinUnlockNoLock:LongWord;
|
SpinUnlockNoOwner:LongWord;
|
SpinLockCounter:LongWord;
|
SpinUnlockCounter:LongWord;
|
SpinDestroyCounter:LongWord;
|
SpinLockIRQCounter:LongWord;
|
SpinUnlockIRQCounter:LongWord;
|
SpinLockFIQCounter:LongWord;
|
SpinUnlockFIQCounter:LongWord;
|
SpinLockIRQFIQCounter:LongWord;
|
SpinUnlockIRQFIQCounter:LongWord;
|
Mutex debug
MutexLockEntry:LongWord;
|
MutexUnlockEntry:LongWord;
|
MutexLockExit:LongWord;
|
MutexUnlockExit:LongWord;
|
MutexUnlockNoLock:LongWord;
|
MutexUnlockNoOwner:LongWord;
|
MutexLockCounter:LongWord;
|
MutexUnlockCounter:LongWord;
|
MutexDestroyCounter:LongWord;
|
Heap manager variables
HeapLock:THeapLock;
|
RTL thread manager variables
ThreadVarBlockSize:DWORD;
|
Initialization handlers
PrimaryInitHandler:TPrimaryInit;
|
SchedulerInitHandler:TSchedulerInit;
|
SchedulerStartHandler:TSchedulerStart;
|
SecondaryInitHandler:TSecondaryInit;
|
SecondaryBootHandler:TSecondaryBoot;
|
SpinLock/Unlock handlers
SpinLockHandler:TSpinLock;
|
SpinUnlockHandler:TSpinUnlock;
|
SpinLockIRQHandler:TSpinLockIRQ;
|
SpinUnlockIRQHandler:TSpinUnlockIRQ;
|
SpinLockFIQHandler:TSpinLockFIQ;
|
SpinUnlockFIQHandler:TSpinUnlockFIQ;
|
SpinLockIRQFIQHandler:TSpinLockIRQFIQ;
|
SpinUnlockIRQFIQHandler:TSpinUnlockIRQFIQ;
|
SpinCheckIRQHandler:TSpinCheckIRQ;
|
SpinCheckFIQHandler:TSpinCheckFIQ;
|
SpinExchangeIRQHandler:TSpinExchangeIRQ;
|
SpinExchangeFIQHandler:TSpinExchangeFIQ;
|
SpinMaskExchangeHandler:TSpinMaskExchange;
|
MutexLock/Unlock handlers
MutexLockHandler:TMutexLock;
|
MutexUnlockHandler:TMutexUnlock;
|
MutexTryLockHandler:TMutexTryLock;
|
CriticalSection Lock/Unlock/TryLock handlers
CriticalSectionLockHandler:TCriticalSectionLock;
|
CriticalSectionLockExHandler:TCriticalSectionLockEx;
|
CriticalSectionUnlockHandler:TCriticalSectionUnlock;
|
CriticalSectionTryLockHandler:TCriticalSectionTryLock;
|
Semaphore Wait/Signal handlers
SemaphoreWaitHandler:TSemaphoreWait;
|
SemaphoreWaitExHandler:TSemaphoreWaitEx;
|
SemaphoreSignalHandler:TSemaphoreSignal;
|
Synchronizer Reader/WriterLock/Unlock handlers
SynchronizerReaderLockHandler:TSynchronizerLock;
|
SynchronizerWriterLockHandler:TSynchronizerLock;
|
SynchronizerReaderLockExHandler:TSynchronizerLockEx;
|
SynchronizerWriterLockExHandler:TSynchronizerLockEx;
|
SynchronizerReaderUnlockHandler:TSynchronizerUnlock;
|
SynchronizerWriterUnlockHandler:TSynchronizerUnlock;
|
SynchronizerReaderConvertHandler:TSynchronizerConvert;
|
SynchronizerWriterConvertHandler:TSynchronizerConvert;
|
SynchronizerReaderConvertExHandler:TSynchronizerConvertEx;
|
Condition Wait/Wake/WakeAll Handlers
ConditionWaitHandler:TConditionWait;
|
ConditionWaitMutexHandler:TConditionWaitMutex;
|
ConditionWaitSynchronizerHandler:TConditionWaitSynchronizer;
|
ConditionWaitCriticalSectionHandler:TConditionWaitCriticalSection;
|
ConditionWakeHandler:TConditionWake;
|
ConditionWakeAllHandler:TConditionWakeAll;
|
Completion Wait/TryWait/Reset/Complete/CompleteAll Handlers
CompletionWaitHandler:TCompletionWait;
|
CompletionTryWaitHandler:TCompletionTryWait;
|
CompletionResetHandler:TCompletionReset;
|
CompletionCompleteHandler:TCompletionComplete;
|
CompletionCompleteAllHandler:TCompletionCompleteAll;
|
Messageslot send and receive handlers
MessageslotSendHandler:TMessageslotSend;
|
MessageslotReceiveHandler:TMessageslotReceive;
|
MessageslotReceiveExHandler:TMessageslotReceiveEx;
|
Mailslot send and receive handlers
MailslotSendHandler:TMailslotSend;
|
MailslotSendExHandler:TMailslotSendEx;
|
MailslotReceiveHandler:TMailslotReceive;
|
MailslotReceiveExHandler:TMailslotReceiveEx;
|
Buffer Get/GetEx/Free handlers
BufferGetHandler:TBufferGet;
|
BufferGetExHandler:TBufferGetEx;
|
BufferFreeHandler:TBufferFree;
|
BufferIterateHandler:TBufferIterate;
|
Event Wait/Set/Reset/Pulse handlers
EventWaitHandler:TEventWait;
|
EventWaitExHandler:TEventWaitEx;
|
EventSetHandler:TEventSet;
|
EventResetHandler:TEventReset;
|
EventPulseHandler:TEventPulse;
|
Timer Enable/Disable/Check/Trigger handlers
TimerEnableHandler:TTimerEnable;
|
TimerEnableExHandler:TTimerEnableEx;
|
TimerDisableHandler:TTimerDisable;
|
TimerCheckHandler:TTimerCheck;
|
TimerTriggerHandler:TTimerTrigger;
|
Tasker Check/Trigger handlers
TaskerCheckHandler:TTaskerCheck;
|
TaskerTriggerHandler:TTaskerTrigger;
|
Thread Get/SetCurrent handlers
ThreadGetCurrentHandler:TThreadGetCurrent;
|
ThreadSetCurrentHandler:TThreadSetCurrent;
|
Scheduler Check/Wakeup/Expire/Select/Switch handlers
SchedulerCheckHandler:TSchedulerCheck;
|
SchedulerWakeupHandler:TSchedulerWakeup;
|
SchedulerExpireHandler:TSchedulerExpire;
|
SchedulerSwitchHandler:TSchedulerSwitch;
|
SchedulerSelectHandler:TSchedulerSelect;
|
SchedulerRescheduleHandler:TSchedulerReschedule;
|
SchedulerMigrationEnableHandler:TSchedulerMigrationEnable;
|
SchedulerMigrationDisableHandler:TSchedulerMigrationDisable;
|
SchedulerPreemptEnableHandler:TSchedulerPreemptEnable;
|
SchedulerPreemptDisableHandler:TSchedulerPreemptDisable;
|
SchedulerAllocationEnableHandler:TSchedulerAllocationEnable;
|
SchedulerAllocationDisableHandler:TSchedulerAllocationDisable;
|
Thread SetupStack handlers
ThreadSetupStackHandler:TThreadSetupStack;
|
Function declarations
Initialization functions
procedure SchedulerStart(CPUID:LongWord);
procedure SecondaryBoot(CPUID:LongWord);
procedure SecondaryStart(CPUID:LongWord);
function TimerPriorityExecute(Parameter:Pointer):PtrInt;
function WorkerPriorityExecute(Parameter:Pointer):PtrInt;
function IdleCalibrate:LongWord;
Spin functions
function SpinCreate:TSpinHandle; {$IFDEF SPIN_INLINE}inline; {$ENDIF}
function SpinCreateEx(InitialOwner:Boolean):TSpinHandle;
function SpinDestroy(Spin:TSpinHandle):LongWord;
function SpinOwner(Spin:TSpinHandle):TThreadHandle;
function SpinLock(Spin:TSpinHandle):LongWord; {$IFDEF SPIN_INLINE}inline; {$ENDIF}
function SpinUnlock(Spin:TSpinHandle):LongWord; {$IFDEF SPIN_INLINE}inline; {$ENDIF}
function SpinLockIRQ(Spin:TSpinHandle):LongWord; {$IFDEF SPIN_INLINE}inline; {$ENDIF}
function SpinUnlockIRQ(Spin:TSpinHandle):LongWord; {$IFDEF SPIN_INLINE}inline; {$ENDIF}
function SpinLockFIQ(Spin:TSpinHandle):LongWord; {$IFDEF SPIN_INLINE}inline; {$ENDIF}
function SpinUnlockFIQ(Spin:TSpinHandle):LongWord; {$IFDEF SPIN_INLINE}inline; {$ENDIF}
function SpinLockIRQFIQ(Spin:TSpinHandle):LongWord; {$IFDEF SPIN_INLINE}inline; {$ENDIF}
function SpinUnlockIRQFIQ(Spin:TSpinHandle):LongWord; {$IFDEF SPIN_INLINE}inline; {$ENDIF}
function SpinLockPreempt(Spin:TSpinHandle):LongWord; {$IFDEF SPIN_INLINE}inline; {$ENDIF}
function SpinUnlockPreempt(Spin:TSpinHandle):LongWord; {$IFDEF SPIN_INLINE}inline; {$ENDIF}
function SpinCheckIRQ(Spin:TSpinHandle):Boolean;
function SpinCheckFIQ(Spin:TSpinHandle):Boolean;
function SpinExchangeIRQ(Spin1,Spin2:TSpinHandle):LongWord;
function SpinExchangeFIQ(Spin1,Spin2:TSpinHandle):LongWord;
function SpinLockDefault(SpinEntry:PSpinEntry):LongWord;
function SpinUnlockDefault(SpinEntry:PSpinEntry):LongWord;
function SpinLockIRQDefault(SpinEntry:PSpinEntry):LongWord;
function SpinUnlockIRQDefault(SpinEntry:PSpinEntry):LongWord;
function SpinLockFIQDefault(SpinEntry:PSpinEntry):LongWord;
function SpinUnlockFIQDefault(SpinEntry:PSpinEntry):LongWord;
function SpinLockIRQFIQDefault(SpinEntry:PSpinEntry):LongWord;
function SpinUnlockIRQFIQDefault(SpinEntry:PSpinEntry):LongWord;
Mutex functions
function MutexCreate:TMutexHandle; {$IFDEF MUTEX_INLINE}inline; {$ENDIF}
function MutexCreateEx(InitialOwner:Boolean; SpinCount:LongWord; Flags:LongWord):TMutexHandle;
function MutexDestroy(Mutex:TMutexHandle):LongWord;
function MutexFlags(Mutex:TMutexHandle):LongWord;
function MutexCount(Mutex:TMutexHandle):LongWord;
function MutexOwner(Mutex:TMutexHandle):TThreadHandle;
function MutexLock(Mutex:TMutexHandle):LongWord; {$IFDEF MUTEX_INLINE}inline; {$ENDIF}
function MutexUnlock(Mutex:TMutexHandle):LongWord; {$IFDEF MUTEX_INLINE}inline; {$ENDIF}
function MutexTryLock(Mutex:TMutexHandle):LongWord; {$IFDEF MUTEX_INLINE}inline; {$ENDIF}
function MutexLockDefault(MutexEntry:PMutexEntry):LongWord;
function MutexUnlockDefault(MutexEntry:PMutexEntry):LongWord;
function MutexTryLockDefault(MutexEntry:PMutexEntry):LongWord;
Critical section functions
function CriticalSectionCreate:TCriticalSectionHandle;
function CriticalSectionCreateEx(InitialOwner:Boolean; SpinCount:LongWord):TCriticalSectionHandle;
function CriticalSectionDestroy(CriticalSection:TCriticalSectionHandle):LongWord;
function CriticalSectionCount(CriticalSection:TCriticalSectionHandle):LongWord;
function CriticalSectionOwner(CriticalSection:TCriticalSectionHandle):TThreadHandle;
function CriticalSectionSetSpinCount(CriticalSection:TCriticalSectionHandle; SpinCount:LongWord):LongWord;
function CriticalSectionLock(CriticalSection:TCriticalSectionHandle):LongWord;
function CriticalSectionLockEx(CriticalSection:TCriticalSectionHandle; Timeout:LongWord):LongWord;
function CriticalSectionUnlock(CriticalSection:TCriticalSectionHandle):LongWord;
function CriticalSectionTryLock(CriticalSection:TCriticalSectionHandle):LongWord;
Semaphore functions
function SemaphoreCreate(Count:LongWord):TSemaphoreHandle;
function SemaphoreCreateEx(Count,Maximum:LongWord; Flags:LongWord):TSemaphoreHandle;
function SemaphoreDestroy(Semaphore:TSemaphoreHandle):LongWord;
function SemaphoreCount(Semaphore:TSemaphoreHandle):LongWord;
function SemaphoreWait(Semaphore:TSemaphoreHandle):LongWord;
function SemaphoreWaitEx(Semaphore:TSemaphoreHandle; Timeout:LongWord):LongWord;
function SemaphoreSignal(Semaphore:TSemaphoreHandle):LongWord;
function SemaphoreSignalEx(Semaphore:TSemaphoreHandle; Count:LongWord; Previous:PLongWord):LongWord;
Synchronizer functions
function SynchronizerCreate:TSynchronizerHandle;
function SynchronizerCreateEx(InitialReader,InitialWriter:Boolean):TSynchronizerHandle;
function SynchronizerDestroy(Synchronizer:TSynchronizerHandle):LongWord;
function SynchronizerReaderCount(Synchronizer:TSynchronizerHandle):LongWord;
function SynchronizerReaderLast(Synchronizer:TSynchronizerHandle):TThreadHandle;
function SynchronizerReaderLock(Synchronizer:TSynchronizerHandle):LongWord;
function SynchronizerReaderLockEx(Synchronizer:TSynchronizerHandle; Timeout:LongWord):LongWord;
function SynchronizerReaderUnlock(Synchronizer:TSynchronizerHandle):LongWord;
function SynchronizerReaderConvert(Synchronizer:TSynchronizerHandle):LongWord;
function SynchronizerReaderConvertEx(Synchronizer:TSynchronizerHandle; Timeout:LongWord):LongWord;
function SynchronizerWriterCount(Synchronizer:TSynchronizerHandle):LongWord;
function SynchronizerWriterOwner(Synchronizer:TSynchronizerHandle):TThreadHandle;
function SynchronizerWriterLock(Synchronizer:TSynchronizerHandle):LongWord;
function SynchronizerWriterLockEx(Synchronizer:TSynchronizerHandle; Timeout:LongWord):LongWord;
function SynchronizerWriterUnlock(Synchronizer:TSynchronizerHandle):LongWord;
function SynchronizerWriterConvert(Synchronizer:TSynchronizerHandle):LongWord;
Condition functions
function ConditionCreate:TConditionHandle;
function ConditionDestroy(Condition:TConditionHandle):LongWord;
function ConditionWait(Condition:TConditionHandle; Timeout:LongWord = INFINITE):LongWord;
function ConditionWaitMutex(Condition:TConditionHandle; Mutex:TMutexHandle; Timeout:LongWord = INFINITE):LongWord;
function ConditionWaitSynchronizer(Condition:TConditionHandle; Synchronizer:TSynchronizerHandle; Flags:LongWord; Timeout:LongWord = INFINITE):LongWord;
function ConditionWaitCriticalSection(Condition:TConditionHandle; CriticalSection:TCriticalSectionHandle; Timeout:LongWord = INFINITE):LongWord;
function ConditionWake(Condition:TConditionHandle):LongWord;
function ConditionWakeAll(Condition:TConditionHandle):LongWord;
Completion functions
function CompletionLock(Completion:PCompletionEntry):LongWord; {$IFDEF COMPLETION_INLINE}inline; {$ENDIF}
function CompletionUnlock(Completion:PCompletionEntry):LongWord; {$IFDEF COMPLETION_INLINE}inline; {$ENDIF}
function CompletionCreate(Flags:LongWord = COMPLETION_FLAG_NONE):TCompletionHandle;
function CompletionDestroy(Completion:TCompletionHandle):LongWord;
function CompletionState(Completion:TCompletionHandle):LongWord;
function CompletionWait(Completion:TCompletionHandle; Timeout:LongWord = INFINITE):LongWord;
function CompletionTryWait(Completion:TCompletionHandle):LongWord;
function CompletionReset(Completion:TCompletionHandle):LongWord;
function CompletionComplete(Completion:TCompletionHandle):LongWord;
function CompletionCompleteAll(Completion:TCompletionHandle):LongWord;
List functions
function ListCreate:TListHandle; {$IFDEF LIST_INLINE}inline; {$ENDIF}
function ListCreateEx(ListType:LongWord; Flags:LongWord):TListHandle;
function ListDestroy(List:TListHandle):LongWord;
function ListCount(List:TListHandle):LongWord;
function ListAddFirst(List:TListHandle; Element:PListElement):LongWord;
function ListAddLast(List:TListHandle; Element:PListElement):LongWord;
function ListGetThread(List:TListHandle; Thread:TThreadHandle):PListElement;
function ListGetFirst(List:TListHandle):PListElement;
function ListGetFirstEx(List:TListHandle; Remove:Boolean):PListElement;
function ListGetLast(List:TListHandle):PListElement;
function ListGetLastEx(List:TListHandle; Remove:Boolean):PListElement;
function ListInsert(List:TListHandle; Previous,Element:PListElement):LongWord;
function ListRemove(List:TListHandle; Element:PListElement):LongWord;
function ListIsEmpty(List:TListHandle):Boolean;
function ListNotEmpty(List:TListHandle):Boolean;
function ListLock(List:TListHandle):LongWord; {$IFDEF LIST_INLINE}inline; {$ENDIF}
function ListUnlock(List:TListHandle):LongWord; {$IFDEF LIST_INLINE}inline; {$ENDIF}
Queue functions
function QueueCreate:TQueueHandle; {$IFDEF QUEUE_INLINE}inline; {$ENDIF}
function QueueCreateEx(QueueType:LongWord; Flags:LongWord):TQueueHandle;
function QueueDestroy(Queue:TQueueHandle):LongWord;
function QueueCount(Queue:TQueueHandle):LongWord;
function QueueEnqueue(Queue:TQueueHandle; Thread:TThreadHandle):LongWord;
function QueueDequeue(Queue:TQueueHandle):TThreadHandle;
function QueueFirstKey(Queue:TQueueHandle):Integer;
function QueueLastKey(Queue:TQueueHandle):Integer;
function QueueInsertKey(Queue:TQueueHandle; Thread:TThreadHandle; Key:Integer):LongWord;
function QueueDeleteKey(Queue:TQueueHandle; Thread:TThreadHandle):LongWord;
function QueueIncrementKey(Queue:TQueueHandle):Integer;
function QueueDecrementKey(Queue:TQueueHandle):Integer;
function QueueIsEmpty(Queue:TQueueHandle):Boolean;
function QueueNotEmpty(Queue:TQueueHandle):Boolean;
function QueueLock(Queue:TQueueHandle):LongWord; {$IFDEF QUEUE_INLINE}inline; {$ENDIF}
function QueueUnlock(Queue:TQueueHandle):LongWord; {$IFDEF QUEUE_INLINE}inline; {$ENDIF}
Thread functions
function ThreadCreate(StartProc:TThreadStart; StackSize,Priority:LongWord; Name:PChar; Parameter:Pointer):TThreadHandle;
function ThreadCreateEx(StartProc:TThreadStart; StackSize,Priority,Affinity,CPU:LongWord; Name:PChar; Parameter:Pointer):TThreadHandle;
function ThreadDestroy(Thread:TThreadHandle):LongWord;
function ThreadGetCurrent:TThreadHandle; inline;
function ThreadSetCurrent(Thread:TThreadHandle):LongWord; inline;
function ThreadGetName(Thread:TThreadHandle):String;
function ThreadSetName(Thread:TThreadHandle; const Name:String):LongWord;
function ThreadGetCPU(Thread:TThreadHandle):LongWord;
function ThreadSetCPU(Thread:TThreadHandle; CPU:LongWord):LongWord;
function ThreadGetState(Thread:TThreadHandle):LongWord;
function ThreadGetFlags(Thread:TThreadHandle):LongWord;
function ThreadSetFlags(Thread:TThreadHandle; Flags:LongWord):LongWord;
function ThreadAddFlags(Thread:TThreadHandle; Flags:LongWord):LongWord;
function ThreadRemoveFlags(Thread:TThreadHandle; Flags:LongWord):LongWord;
function ThreadGetLocale(Thread:TThreadHandle):LCID;
function ThreadSetLocale(Thread:TThreadHandle; Locale:LCID):LongWord;
function ThreadGetTimes(Thread:TThreadHandle; var CreateTime,ExitTime,KernelTime:Int64):LongWord;
function ThreadGetSwitchCount(Thread:TThreadHandle; var SwitchCount:Int64):LongWord;
function ThreadGetStackFree:LongWord;
function ThreadGetStackSize(Thread:TThreadHandle):LongWord;
function ThreadGetStackBase(Thread:TThreadHandle):PtrUInt;
function ThreadSetStackBase(Thread:TThreadHandle; StackBase:PtrUInt):LongWord;
function ThreadGetStackPointer(Thread:TThreadHandle):PtrUInt;
function ThreadGetExitCode(Thread:TThreadHandle):LongWord;
function ThreadGetAffinity(Thread:TThreadHandle):LongWord;
function ThreadSetAffinity(Thread:TThreadHandle; Affinity:LongWord):LongWord;
function ThreadGetPriority(Thread:TThreadHandle):LongWord;
function ThreadSetPriority(Thread:TThreadHandle; Priority:LongWord):LongWord;
function ThreadGetLastError:LongWord;
procedure ThreadSetLastError(LastError:LongWord);
function ThreadSetLastErrorEx(LastError:LongWord):LongWord;
function ThreadGetWaitResult:LongWord;
function ThreadGetReceiveResult:LongWord;
function ThreadGetTlsIndex(TlsIndex:LongWord):LongWord;
function ThreadAllocTlsIndex:LongWord; inline;
function ThreadAllocTlsIndexEx(Flags:LongWord):LongWord;
function ThreadReleaseTlsIndex(TlsIndex:LongWord):LongWord;
function ThreadGetTlsValue(TlsIndex:LongWord):Pointer;
function ThreadSetTlsValue(TlsIndex:LongWord; TlsValue:Pointer):LongWord;
function ThreadGetTlsPointer(Thread:TThreadHandle):Pointer;
function ThreadSetTlsPointer(Thread:TThreadHandle; TlsPointer:Pointer):LongWord;
function ThreadReady(Thread:TThreadHandle; Reschedule:Boolean):LongWord;
function ThreadTimeout(Thread:TThreadHandle):LongWord;
function ThreadWake(Thread:TThreadHandle):LongWord;
function ThreadMigrate(Thread:TThreadHandle; CPU:LongWord):LongWord;
function ThreadHalt(ExitCode:LongWord):LongWord;
function ThreadTerminate(Thread:TThreadHandle; ExitCode:LongWord):LongWord;
function ThreadYield:LongWord;
function ThreadSleep(Milliseconds:LongWord):LongWord;
function ThreadWait(List:TListHandle; Lock:TSpinHandle; Flags:LongWord):LongWord;
function ThreadWaitEx(List:TListHandle; Lock:TSpinHandle; Flags,Timeout:LongWord):LongWord;
function ThreadRelease(List:TListHandle):LongWord;
function ThreadAbandon(List:TListHandle):LongWord;
function ThreadWaitTerminate(Thread:TThreadHandle; Timeout:LongWord):LongWord;
function ThreadSuspend(Thread:TThreadHandle):LongWord;
function ThreadResume(Thread:TThreadHandle):LongWord;
function ThreadWaitMessage:LongWord;
function ThreadSendMessage(Thread:TThreadHandle; const Message:TMessage):LongWord;
function ThreadReceiveMessage(var Message:TMessage):LongWord;
function ThreadReceiveMessageEx(var Message:TMessage; Timeout:LongWord; Remove:Boolean):LongWord;
function ThreadAbandonMessage(Thread:TThreadHandle):LongWord;
function ThreadLock(Thread:TThreadHandle):LongWord;
function ThreadUnlock(Thread:TThreadHandle):LongWord;
procedure ThreadTimer(Data:Pointer);
Scheduler functions
function SchedulerCheck(CPUID:LongWord):LongWord;
function SchedulerWakeup(CPUID:LongWord):LongWord;
function SchedulerExpire(CPUID:LongWord):LongWord;
function SchedulerSwitch(CPUID:LongWord; Thread:TThreadHandle):TThreadHandle;
function SchedulerSelect(CPUID:LongWord; Thread:TThreadHandle; Yield:Boolean):TThreadHandle;
function SchedulerReschedule(Yield:Boolean):LongWord;
function SchedulerMigrationDisable:LongWord;
function SchedulerPreemptEnable(CPUID:LongWord):LongWord;
function SchedulerPreemptDisable(CPUID:LongWord):LongWord;
function SchedulerAllocationEnable(CPUID:LongWord):LongWord;
function SchedulerAllocationDisable(CPUID:LongWord):LongWord;
Messageslot functions
function MessageslotCreate:TMessageslotHandle;
function MessageslotCreateEx(Maximum:LongWord; Flags:LongWord):TMessageslotHandle;
function MessageslotDestroy(Messageslot:TMessageslotHandle):LongWord;
function MessageslotCount(Messageslot:TMessageslotHandle):LongWord;
function MessageslotSend(Messageslot:TMessageslotHandle; const Message:TMessage):LongWord;
function MessageslotReceive(Messageslot:TMessageslotHandle; var Message:TMessage):LongWord;
function MessageslotReceiveEx(Messageslot:TMessageslotHandle; var Message:TMessage; Timeout:LongWord):LongWord;
Mailslot functions
function MailslotCreate(Maximum:LongWord):TMailslotHandle;
function MailslotDestroy(Mailslot:TMailslotHandle):LongWord;
function MailslotCount(Mailslot:TMailslotHandle):LongWord;
function MailslotSend(Mailslot:TMailslotHandle; Data:Integer):LongWord;
function MailslotSendEx(Mailslot:TMailslotHandle; Data:Integer; Timeout:LongWord):LongWord;
function MailslotReceive(Mailslot:TMailslotHandle):Integer;
function MailslotReceiveEx(Mailslot:TMailslotHandle; Timeout:LongWord):Integer;
Buffer functions
function BufferCreateEx(Size,Count,Flags:LongWord):TBufferHandle;
function BufferGetEx(Buffer:TBufferHandle; Timeout:LongWord):Pointer;
function BufferIterate(Buffer:TBufferHandle; Previous:Pointer):Pointer;
Event functions
function EventCreate(ManualReset,InitialState:Boolean):TEventHandle;
function EventWaitEx(Event:TEventHandle; Timeout:LongWord):LongWord;
Timer functions
function TimerCreate(Interval:LongWord; Enabled,Reschedule:Boolean; Event:TTimerEvent; Data:Pointer):TTimerHandle;
function TimerCreateEx(Interval,State,Flags:LongWord; Event:TTimerEvent; Data:Pointer):TTimerHandle;
function TimerEnableEx(Timer:TTimerHandle; Interval:LongWord; Event:TTimerEvent; Data:Pointer):LongWord;
function TimerInsertKey(Timer:TTimerHandle; Key:Integer):LongWord;
Worker functions
function WorkerSchedule(Interval:LongWord; Task:TWorkerTask; Data:Pointer; Callback:TWorkerCallback):LongWord;
function WorkerScheduleEx(Interval,Flags:LongWord; Task:TWorkerTask; Data:Pointer; Callback:TWorkerCallback):TWorkerHandle;
function WorkerScheduleIRQ(Affinity:LongWord; Task:TWorkerTask; Data:Pointer; Callback:TWorkerCallback):LongWord;
function WorkerScheduleIRQEx(Affinity,Flags:LongWord; Task:TWorkerTask; Data:Pointer; Callback:TWorkerCallback):LongWord;
function WorkerScheduleFIQ(Affinity:LongWord; Task:TWorkerTask; Data:Pointer; Callback:TWorkerCallback):LongWord;
function WorkerScheduleFIQEx(Affinity,Flags:LongWord; Task:TWorkerTask; Data:Pointer; Callback:TWorkerCallback):LongWord;
function WorkerIncreaseEx(Count:LongWord; Priority:Boolean):LongWord;
function WorkerDecreaseEx(Count:LongWord; Priority:Boolean):LongWord;
procedure WorkerTimer(WorkerRequest:PWorkerRequest);
Tasker functions
function TaskerThreadSendMessage(Thread:TThreadHandle; const Message:TMessage):LongWord;
function TaskerMessageslotSend(Messageslot:TMessageslotHandle; const Message:TMessage):LongWord;
function TaskerSemaphoreSignal(Semaphore:TSemaphoreHandle; Count:LongWord):LongWord;
function TaskerEnqueue(Task:PTaskerTask):LongWord;
function TaskerDequeue:PTaskerTask;
function TaskerCheck:LongWord;
function TaskerTrigger:LongWord;
RTL initialize and exit functions
RTL process functions
RTL thread manager functions
function SysBeginThread(SignalAction:Pointer; StackSize:PtrUInt; ThreadFunction:TThreadFunc; ThreadParameter:Pointer; CreationFlags:DWORD; var ThreadId:TThreadID):TThreadID;
function SysBeginThreadEx(SignalAction:Pointer; StackSize:PtrUInt; ThreadFunction:TThreadFunc; ThreadParameter:Pointer; CreationFlags:DWORD; Priority,Affinity,CPU:LongWord; Name:PChar; var ThreadId:TThreadID):TThreadID;
function SysWaitForThreadTerminate(ThreadHandle:TThreadID; TimeoutMs:LongInt):DWORD;
function SysThreadSetPriority(ThreadHandle:TThreadID; Priority:LongInt):Boolean;
function SysThreadGetPriority(ThreadHandle:TThreadID):LongInt;
function SysTryEnterCriticalSection(var CriticalSection):LongInt;
function SysBasicEventCreate(EventAttributes:Pointer; AManualReset,InitialState:Boolean; const Name:AnsiString):PEventState;
function SysBasicEventWaitFor(Timeout:Cardinal; State:PEventState):LongInt;
procedure SysRTLEventWaitForTimeout(AEvent:PRTLEvent; Timeout:LongInt);
Thread helper functions
function CompletionGetCount:LongWord; inline;
procedure ThreadReleaseStack(StackBase:Pointer; StackSize:LongWord);
function ThreadSetupStack(StackBase:Pointer; StartProc:TThreadStart; ReturnProc:TThreadEnd; Parameter:Pointer):Pointer;
function ThreadSnapshotDestroy(ASnapshot:PThreadSnapshot):LongWord;
function ThreadPriorityToString(ThreadPriority:LongWord):String;
Scheduler helper functions
function SchedulerGetQueueFlags(QueueType:LongWord):LongWord;
function SchedulerGetQueueHandle(CPUID:LongWord; QueueType:LongWord):TQueueHandle;
function SchedulerGetQueueHandleEx(CPUID:LongWord; Priority:LongWord):TQueueHandle;
function SchedulerGetThreadHandle(CPUID:LongWord; ThreadType:LongWord):TThreadHandle;
function SchedulerGetPriorityQuantum(Priority:LongWord):LongWord;
function SchedulerSetPriorityQuantum(Priority,Quantum:LongWord):LongWord;
function SchedulerGetStarvationQuantum(CPUID:LongWord):LongWord;
function SchedulerGetThreadAllocation(CPUID:LongWord):LongWord;
function SchedulerMigrationToString(Migration:LongWord):String;
function SchedulerAllocationToString(Allocation:LongWord):String;
Timer helper functions
Worker helper functions
Return to Unit Reference