Difference between revisions of "Unit Threads"
Line 1,052: | Line 1,052: | ||
---- | ---- | ||
− | '' | + | |
+ | '''Spin entry''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PSpinEntry = ^TSpinEntry;</code> | ||
+ | |||
+ | <code>TSpinEntry = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|''Spin Properties'' | ||
+ | |- | ||
+ | | <code>Signature:LongWord;</code> | ||
+ | | Signature for entry validation | ||
+ | |- | ||
+ | | <code>State:LongWord;</code> | ||
+ | | State of the lock (Locked/Unlocked) | ||
+ | |- | ||
+ | | <code>Mask:LongWord;</code> | ||
+ | | IRQ/FIQ Mask for Save/Restore | ||
+ | |- | ||
+ | | <code>Owner:TThreadHandle;</code> | ||
+ | | Currently owning thread (or INVALID_HANDLE_VALUE if not locked) | ||
+ | |- | ||
+ | |colspan="2"|''Internal Properties'' | ||
+ | |- | ||
+ | | <code>Prev:PSpinEntry;</code> | ||
+ | | Previous entry in Spin table | ||
+ | |- | ||
+ | | <code>Next:PSpinEntry;</code> | ||
+ | | Next entry in Spin table | ||
+ | |- | ||
+ | |colspan="2"|''Statistics Properties'' | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Mutex entry''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PMutexEntry = ^TMutexEntry;</code> | ||
+ | |||
+ | <code>TMutexEntry = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|''Mutex Properties'' | ||
+ | |- | ||
+ | | <code>Signature:LongWord;</code> | ||
+ | | Signature for entry validation | ||
+ | |- | ||
+ | | <code>State:LongWord;</code> | ||
+ | | State of the lock (Locked/Unlocked) | ||
+ | |- | ||
+ | | <code>Owner:TThreadHandle;</code> | ||
+ | | Currently owning thread (or INVALID_HANDLE_VALUE if not locked) | ||
+ | |- | ||
+ | | <code>Yield:TThreadYield;</code> | ||
+ | | Yield function to call while waiting | ||
+ | |- | ||
+ | | <code>Count:LongWord;</code> | ||
+ | | Count of lock recursions (only if Flags includes MUTEX_FLAG_RECURSIVE) | ||
+ | |- | ||
+ | | <code>Flags:LongWord;</code> | ||
+ | | Mutex Flags (eg MUTEX_FLAG_RECURSIVE) | ||
+ | |- | ||
+ | | <code>SpinCount:LongWord;</code> | ||
+ | | Number of times to spin wait for lock before Yield is called (Always 0 if SCHEDULER_CPU_COUNT = 1) | ||
+ | |- | ||
+ | |colspan="2"|''Internal Properties'' | ||
+ | |- | ||
+ | | <code>Prev:PMutexEntry;</code> | ||
+ | | Previous entry in Mutex table | ||
+ | |- | ||
+ | | <code>Next:PMutexEntry;</code> | ||
+ | | Next entry in Mutex table | ||
+ | |- | ||
+ | |colspan="2"|''Statistics Properties'' | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Critical section entry''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PCriticalSectionEntry = ^TCriticalSectionEntry;</code> | ||
+ | |||
+ | <code>TCriticalSectionEntry = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|''Critical Section Properties'' | ||
+ | |- | ||
+ | | <code>Signature:LongWord;</code> | ||
+ | | Signature for entry validation | ||
+ | |- | ||
+ | | <code>State:LongWord;</code> | ||
+ | | State of the lock (Locked/Unlocked) | ||
+ | |- | ||
+ | | <code>Count:LongWord;</code> | ||
+ | | Count of lock recursions | ||
+ | |- | ||
+ | | <code>Owner:TThreadHandle;</code> | ||
+ | | Currently owning thread (or INVALID_HANDLE_VALUE if not locked) | ||
+ | |- | ||
+ | | <code>SpinCount:LongWord;</code> | ||
+ | | Number of times to spin wait for lock before Wait is called (Always 0 if SCHEDULER_CPU_COUNT = 1) | ||
+ | |- | ||
+ | | <code>Lock:TSpinHandle;</code> | ||
+ | | Critical Section Lock | ||
+ | |- | ||
+ | | <code>List:TListHandle;</code> | ||
+ | | List of threads waiting on this CriticalSection (or INVALID_HANDLE_VALUE if never used) | ||
+ | |- | ||
+ | | <code>Wait:TThreadWait;</code> | ||
+ | | Wait function to call to wait on the CriticalSection if it is already locked | ||
+ | |- | ||
+ | | <code>WaitEx:TThreadWaitEx;</code> | ||
+ | | Wait function to call to wait with timeout on the CriticalSection if it is already locked | ||
+ | |- | ||
+ | | <code>Release:TThreadRelease;</code> | ||
+ | | Release function to call if any threads are waiting when CriticalSection is unlocked | ||
+ | |- | ||
+ | | <code>Abandon:TThreadAbandon;</code> | ||
+ | | Abandon function to call if any threads are waiting when CriticalSection is destroyed | ||
+ | |- | ||
+ | |colspan="2"|''Internal Properties'' | ||
+ | |- | ||
+ | | <code>Prev:PCriticalSectionEntry;</code> | ||
+ | | Previous entry in CriticalSection table | ||
+ | |- | ||
+ | | <code>Next:PCriticalSectionEntry;</code> | ||
+ | | Next entry in CriticalSection table | ||
+ | |- | ||
+ | |colspan="2"|''Statistics Properties'' | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Semaphore entry''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PSemaphoreEntry = ^TSemaphoreEntry;</code> | ||
+ | |||
+ | <code>TSemaphoreEntry = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|''Semaphore Properties'' | ||
+ | |- | ||
+ | | <code>Signature:LongWord;</code> | ||
+ | | Signature for entry validation | ||
+ | |- | ||
+ | | <code>Count:LongWord;</code> | ||
+ | | Count for this Semaphore (Can be negative when Threads are waiting) | ||
+ | |- | ||
+ | | <code>Maximum:LongWord;</code> | ||
+ | | Maximum count for this Semaphore | ||
+ | |- | ||
+ | | <code>Flags:LongWord;</code> | ||
+ | | Semaphore Flags (eg SEMAPHORE_FLAG_IRQ) | ||
+ | |- | ||
+ | | <code>Lock:TSpinHandle;</code> | ||
+ | | Semaphore Lock | ||
+ | |- | ||
+ | | <code>List:TListHandle;</code> | ||
+ | | List of threads waiting on this Semaphore (or INVALID_HANDLE_VALUE if never used) | ||
+ | |- | ||
+ | | <code>Wait:TThreadWait;</code> | ||
+ | | Wait function to call to wait on the Semaphore if the count is equal to zero on SemaphoreWait | ||
+ | |- | ||
+ | | <code>WaitEx:TThreadWaitEx;</code> | ||
+ | | Wait function to call to wait with timeout on the Semaphore if the count is equal to zero on SemaphoreWait | ||
+ | |- | ||
+ | | <code>Release:TThreadRelease;</code> | ||
+ | | Release function to call if any threads are waiting on SemaphoreSignal | ||
+ | |- | ||
+ | | <code>Abandon:TThreadAbandon;</code> | ||
+ | | Abandon function to call if any threads are waiting when SemaphoreSignal is destroyed | ||
+ | |- | ||
+ | |colspan="2"|''Internal Properties'' | ||
+ | |- | ||
+ | | <code>Prev:PSemaphoreEntry;</code> | ||
+ | | Previous entry in Semaphore table | ||
+ | |- | ||
+ | | <code>Next:PSemaphoreEntry;</code> | ||
+ | | Next entry in Semaphore table | ||
+ | |- | ||
+ | |colspan="2"|''Statistics Properties'' | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Synchronizer entry''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PSynchronizerEntry = ^TSynchronizerEntry;</code> | ||
+ | |||
+ | <code>TSynchronizerEntry = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|''Synchronizer Properties'' | ||
+ | |- | ||
+ | | <code>Signature:LongWord;</code> | ||
+ | | Signature for entry validation | ||
+ | |- | ||
+ | | <code>State:LongWord;</code> | ||
+ | | State of the lock (Locked/Unlocked) | ||
+ | |- | ||
+ | | <code>Lock:TSpinHandle;</code> | ||
+ | | Synchronizer Lock | ||
+ | |- | ||
+ | | <code>ReaderCount:LongWord;</code> | ||
+ | | Count of current reader locks | ||
+ | |- | ||
+ | | <code>WriterCount:LongWord;</code> | ||
+ | | Count of current writer lock recursions | ||
+ | |- | ||
+ | | <code>ReaderLast:TThreadHandle;</code> | ||
+ | | Last thread to acquire reader lock (or INVALID_HANDLE_VALUE if no reader) | ||
+ | |- | ||
+ | | <code>WriterOwner:TThreadHandle;</code> | ||
+ | | Currently owning writer thread (or INVALID_HANDLE_VALUE if no writer) | ||
+ | |- | ||
+ | | <code>ReaderList:TListHandle;</code> | ||
+ | | List of reader threads waiting on this Synchronizer (or INVALID_HANDLE_VALUE if never used) | ||
+ | |- | ||
+ | | <code>WriterList:TListHandle;</code> | ||
+ | | List of writer threads waiting on this Synchronizer (or INVALID_HANDLE_VALUE if never used) | ||
+ | |- | ||
+ | | <code>Wait:TThreadWait;</code> | ||
+ | | Wait function to call to wait on the Synchronizer if it is already locked | ||
+ | |- | ||
+ | | <code>WaitEx:TThreadWaitEx;</code> | ||
+ | | Wait function to call to wait with timeout on the Synchronizer if it is already locked | ||
+ | |- | ||
+ | | <code>Release:TThreadRelease;</code> | ||
+ | | Release function to call if any threads are waiting when Synchronizer is unlocked | ||
+ | |- | ||
+ | | <code>Abandon:TThreadAbandon;</code> | ||
+ | | Abandon function to call if any threads are waiting when Synchronizer is destroyed | ||
+ | |- | ||
+ | |colspan="2"|''Internal Properties'' | ||
+ | |- | ||
+ | | <code>Prev:PSynchronizerEntry;</code> | ||
+ | | Previous entry in Synchronizer table | ||
+ | |- | ||
+ | | <code>Next:PSynchronizerEntry;</code> | ||
+ | | Next entry in Synchronizer table | ||
+ | |- | ||
+ | |colspan="2"|''Statistics Properties'' | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''List entry''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PListEntry = ^TListEntry;</code> | ||
+ | |||
+ | <code>TListEntry = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|''List Properties'' | ||
+ | |- | ||
+ | | <code>Signature:LongWord;</code> | ||
+ | | Signature for entry validation | ||
+ | |- | ||
+ | | <code>ListType:LongWord;</code> | ||
+ | | Type of this List (eg LIST_TYPE_WAIT_SECTION) | ||
+ | |- | ||
+ | | <code>Count:LongWord;</code> | ||
+ | | Count of items currently in this List | ||
+ | |- | ||
+ | | <code>Flags:LongWord;</code> | ||
+ | | List Flags (eg LIST_FLAG_IRQ) | ||
+ | |- | ||
+ | | <code>Lock:TSpinHandle;</code> | ||
+ | | List Lock | ||
+ | |- | ||
+ | | <code>First:PListElement;</code> | ||
+ | | First element in List | ||
+ | |- | ||
+ | | <code>Last:PListElement;</code> | ||
+ | | Last element in List | ||
+ | |- | ||
+ | |colspan="2"|''Internal Properties'' | ||
+ | |- | ||
+ | | <code>Prev:PListEntry;</code> | ||
+ | | Previous entry in List table | ||
+ | |- | ||
+ | | <code>Next:PListEntry;</code> | ||
+ | | Next entry in List table | ||
+ | |- | ||
+ | |colspan="2"|''Statistics Properties'' | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''List element''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PListElement = ^TListElement;</code> | ||
+ | |||
+ | <code>TListElement = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>Thread:TThreadHandle;</code> | ||
+ | | The thread referenced by this List element | ||
+ | |- | ||
+ | | <code>Prev:PListElement;</code> | ||
+ | | Previous element in List | ||
+ | |- | ||
+ | | <code>Next:PListElement;</code> | ||
+ | | Next element in List | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''List handles''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PListHandles = ^TListHandles;</code> | ||
+ | |||
+ | <code>TListHandles = array[0..THREAD_LISTS_MAXIMUM - 1] of TListHandle;</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Queue entry''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PQueueEntry = ^TQueueEntry;</code> | ||
+ | |||
+ | <code>TQueueEntry = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|''Queue Properties'' | ||
+ | |- | ||
+ | | <code>Signature:LongWord;</code> | ||
+ | | Signature for entry validation | ||
+ | |- | ||
+ | | <code>QueueType:LongWord;</code> | ||
+ | | Type of this Queue (eg QUEUE_TYPE_SCHEDULE_IDLE) | ||
+ | |- | ||
+ | | <code>Count:LongWord;</code> | ||
+ | | Count of items currently in this Queue | ||
+ | |- | ||
+ | | <code>Flags:LongWord;</code> | ||
+ | | Queue Flags (eg QUEUE_FLAG_IRQ) | ||
+ | |- | ||
+ | | <code>Lock:TSpinHandle;</code> | ||
+ | | Queue Lock | ||
+ | |- | ||
+ | | <code>First:PQueueElement;</code> | ||
+ | | First element in Queue | ||
+ | |- | ||
+ | | <code>Last:PQueueElement;</code> | ||
+ | | Last element in Queue | ||
+ | |- | ||
+ | |colspan="2"|''Internal Properties'' | ||
+ | |- | ||
+ | | <code>Prev:PQueueEntry;</code> | ||
+ | | Previous entry in Queue table | ||
+ | |- | ||
+ | | <code>Next:PQueueEntry;</code> | ||
+ | | Next entry in Queue table | ||
+ | |- | ||
+ | |colspan="2"|''Statistics Properties'' | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Queue element''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PQueueElement = ^TQueueElement;</code> | ||
+ | |||
+ | <code>TQueueElement = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>Key:Integer;</code> | ||
+ | | Ordering key for Queue | ||
+ | |- | ||
+ | | <code>Thread:TThreadHandle;</code> | ||
+ | | The thread referenced by this Queue element | ||
+ | |- | ||
+ | | <code>Prev:PQueueElement;</code> | ||
+ | | Previous element in Queue | ||
+ | |- | ||
+ | | <code>Next:PQueueElement;</code> | ||
+ | | Next element in Queue | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Message list''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PMessageList = ^TMessageList;</code> | ||
+ | |||
+ | <code>TMessageList = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|''Header Properties'' | ||
+ | |- | ||
+ | | <code>Maximum:LongWord;</code> | ||
+ | | Maximum number of messages in list | ||
+ | |- | ||
+ | | <code>Count:LongWord;</code> | ||
+ | | Current number of messages in list | ||
+ | |- | ||
+ | | <code>Start:LongWord;</code> | ||
+ | | First message available in list | ||
+ | |- | ||
+ | |colspan="2"|''Internal Properties'' | ||
+ | |- | ||
+ | | <code>List:PMessage;</code> | ||
+ | | Message list | ||
+ | |- | ||
+ | |colspan="2"|''Statistics Properties'' | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Message''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PMessage = ^TMessage;</code> | ||
+ | |||
+ | <code>TMessage = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>Msg:LongWord;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>wParam:LongInt;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>lParam:LongInt;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>Time:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Thread entry''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PThreadEntry = ^TThreadEntry;</code> | ||
+ | |||
+ | <code>TThreadEntry = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|''Thread Properties'' | ||
+ | |- | ||
+ | | <code>Signature:LongWord;</code> | ||
+ | | Signature for entry validation | ||
+ | |- | ||
+ | | <code>State:LongWord;</code> | ||
+ | | State of the Thread (eg THREAD_STATE_RUNNING) | ||
+ | |- | ||
+ | | <code>Priority:LongWord;</code> | ||
+ | | Priority of the Thread (eg THREAD_PRIORITY_NORMAL) | ||
+ | |- | ||
+ | | <code>Affinity:LongWord;</code> | ||
+ | | CPU Affinity mask of the Thread | ||
+ | |- | ||
+ | | <code>StackBase:Pointer;</code> | ||
+ | | Base (Top) of the thread stack | ||
+ | |- | ||
+ | | <code>StackSize:LongWord;</code> | ||
+ | | Stack length in bytes | ||
+ | |- | ||
+ | | <code>Name:array[0..THREAD_NAME_LENGTH - 1] of Char;</code> | ||
+ | | The name of the Thread | ||
+ | |- | ||
+ | | <code>Lock:TSpinHandle;</code> | ||
+ | | Thread Lock | ||
+ | |- | ||
+ | | <code>Parent:TThreadHandle;</code> | ||
+ | | Handle of the parent thread | ||
+ | |- | ||
+ | | <code>Messages:TMessageList;</code> | ||
+ | | Messages sent to this thread | ||
+ | |- | ||
+ | | <code>TlsPointer:Pointer;</code> | ||
+ | | Thread Local Storage Memory (RTL ThreadVars) | ||
+ | |- | ||
+ | | <code>TlsTable:array[0..THREAD_TLS_MAXIMUM - 1] of Pointer;</code> | ||
+ | | Thread Local Storage Index Pointers (for ThreadGetTlsValue/ThreadSetTlsValue) | ||
+ | |- | ||
+ | | <code>TlsFlags:array[0..THREAD_TLS_MAXIMUM - 1] of LongWord;</code> | ||
+ | | Thread Local Storage Index Flags (eg THREAD_TLS_FLAG_FREE) | ||
+ | |- | ||
+ | | <code>ExitCode:LongWord;</code> | ||
+ | | Thread Exit Code | ||
+ | |- | ||
+ | | <code>LastError:LongWord;</code> | ||
+ | | Thread Last Error | ||
+ | |- | ||
+ | | <code>Locale:LCID;</code> | ||
+ | | Thread Locale | ||
+ | |- | ||
+ | |colspan="2"|''Internal Properties'' | ||
+ | |- | ||
+ | | <code>CurrentCPU:LongWord;</code> | ||
+ | | Saved current CPU from last ContextSwitch | ||
+ | |- | ||
+ | | <code>StackPointer:Pointer;</code> | ||
+ | | Saved current stack pointer from last ContextSwitch | ||
+ | |- | ||
+ | | <code>TargetCPU:LongWord;</code> | ||
+ | | Target CPU of the Thread for next ContextSwitch | ||
+ | |- | ||
+ | | <code>TargetPriority:LongWord;</code> | ||
+ | | Target Priority of the Thread for next ContextSwitch (eg THREAD_PRIORITY_NORMAL) | ||
+ | |- | ||
+ | | <code>List:TListHandle;</code> | ||
+ | | List of threads waiting on this thread (or INVALID_HANDLE_VALUE if never used) | ||
+ | |- | ||
+ | | <code>WaitList:TListHandle;</code> | ||
+ | | The wait list this thread is currently in (or INVALID_HANDLE_VALUE) | ||
+ | |- | ||
+ | | <code>WaitLists:PListHandles;</code> | ||
+ | | The wait lists this thread is currently in if doing a multiple wait (or nil) | ||
+ | |- | ||
+ | | <code>WaitResult:LongWord;</code> | ||
+ | | The result code for the last wait with timeout (eg WAIT_TIMEOUT) | ||
+ | |- | ||
+ | | <code>ReceiveResult:LongWord;</code> | ||
+ | | The result code for the last receive with timeout (eg WAIT_TIMEOUT) | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>ListElement:TListElement;</code> | ||
+ | | List element for this thread when in a Wait List | ||
+ | |- | ||
+ | | <code>QueueElement:TQueueElement;</code> | ||
+ | | Queue element for this thread when in a Schedule Queue | ||
+ | |- | ||
+ | | <code>Prev:PThreadEntry;</code> | ||
+ | | Previous entry in Thread table | ||
+ | |- | ||
+ | | <code>Next:PThreadEntry;</code> | ||
+ | | Next entry in Thread table | ||
+ | |- | ||
+ | |colspan="2"|''Statistics Properties'' | ||
+ | |- | ||
+ | | <code>CreateTime:Int64;</code> | ||
+ | | The time when this thread was created | ||
+ | |- | ||
+ | | <code>ExitTime:Int64;</code> | ||
+ | | The time when this thread exited or was terminated | ||
+ | |- | ||
+ | | <code>KernelTime:Int64;</code> | ||
+ | | The total amount of time this thread has been in the running state (ie CPU time consumed) | ||
+ | |- | ||
+ | | <code>SwitchCount:Int64;</code> | ||
+ | | The number of times this thread has been selected to run by a context switch | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Thread snapshot''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PThreadSnapshot = ^TThreadSnapshot;</code> | ||
+ | |||
+ | <code>TThreadSnapshot = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|Note: Data returned by ThreadSnapshotCreate | ||
+ | |- | ||
+ | |colspan="2"|''Snapshot Properties'' | ||
+ | |- | ||
+ | | <code>Handle:TThreadHandle;</code> | ||
+ | | Handle of the thread | ||
+ | |- | ||
+ | | <code>State:LongWord;</code> | ||
+ | | State of the Thread (eg THREAD_STATE_RUNNING) | ||
+ | |- | ||
+ | | <code>CPU:LongWord;</code> | ||
+ | | CPU from last ContextSwitch | ||
+ | |- | ||
+ | | <code>Priority:LongWord;</code> | ||
+ | | Priority of the Thread (eg THREAD_PRIORITY_NORMAL) | ||
+ | |- | ||
+ | | <code>Affinity:LongWord;</code> | ||
+ | | CPU Affinity mask of the Thread | ||
+ | |- | ||
+ | | <code>StackBase:Pointer;</code> | ||
+ | | Base (Top) of the thread stack | ||
+ | |- | ||
+ | | <code>StackSize:LongWord;</code> | ||
+ | | Stack length in bytes | ||
+ | |- | ||
+ | | <code>StackPointer:Pointer;</code> | ||
+ | | Stack pointer from last ContextSwitch | ||
+ | |- | ||
+ | | <code>Name:array[0..THREAD_NAME_LENGTH - 1] of Char;</code> | ||
+ | | The name of the Thread | ||
+ | |- | ||
+ | | <code>Parent:TThreadHandle;</code> | ||
+ | | Handle of the parent thread | ||
+ | |- | ||
+ | | <code>ExitCode:LongWord;</code> | ||
+ | | Thread Exit Code | ||
+ | |- | ||
+ | | <code>LastError:LongWord;</code> | ||
+ | | Thread Last Error | ||
+ | |- | ||
+ | | <code>Locale:LCID;</code> | ||
+ | | Thread Locale | ||
+ | |- | ||
+ | | <code>TargetCPU:LongWord;</code> | ||
+ | | Target CPU of the Thread for next ContextSwitch | ||
+ | |- | ||
+ | | <code>TargetPriority:LongWord;</code> | ||
+ | | Target Priority of the Thread for next ContextSwitch (eg THREAD_PRIORITY_NORMAL) | ||
+ | |- | ||
+ | | <code>CreateTime:Int64;</code> | ||
+ | | The time when this thread was created | ||
+ | |- | ||
+ | | <code>ExitTime:Int64;</code> | ||
+ | | The time when this thread exited or was terminated | ||
+ | |- | ||
+ | | <code>KernelTime:Int64;</code> | ||
+ | | The total amount of time this thread has been in the running state (ie CPU time consumed) | ||
+ | |- | ||
+ | | <code>SwitchCount:Int64;</code> | ||
+ | | The number of times this thread has been selected to run by a context switch | ||
+ | |- | ||
+ | |colspan="2"|''Internal Properties'' | ||
+ | |- | ||
+ | | <code>Next:PThreadSnapshot;</code> | ||
+ | | Next entry in Thread snapshot | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Messageslot entry''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PMessageslotEntry = ^TMessageslotEntry;</code> | ||
+ | |||
+ | <code>TMessageslotEntry = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|''Messageslot Properties'' | ||
+ | |- | ||
+ | | <code>Signature:LongWord;</code> | ||
+ | | Signature for entry validation | ||
+ | |- | ||
+ | | <code>Flags:LongWord;</code> | ||
+ | | Messageslot Flags (eg MESSAGESLOT_FLAG_IRQ) | ||
+ | |- | ||
+ | | <code>Lock:TSpinHandle;</code> | ||
+ | | Messageslot Lock | ||
+ | |- | ||
+ | | <code>List:TListHandle;</code> | ||
+ | | List of threads waiting on this Messageslot (or INVALID_HANDLE_VALUE if never used) | ||
+ | |- | ||
+ | | <code>Messages:TMessageList;</code> | ||
+ | | Messageslot message queue | ||
+ | |- | ||
+ | | <code>Wait:TThreadWait;</code> | ||
+ | | Wait function to call to wait on the Messageslot if there are no messages | ||
+ | |- | ||
+ | | <code>WaitEx:TThreadWaitEx;</code> | ||
+ | | Wait function to call to wait with timeout on the Messageslot if there are no messages | ||
+ | |- | ||
+ | | <code>Release:TThreadRelease;</code> | ||
+ | | Release function to call if any threads are waiting when a message is sent | ||
+ | |- | ||
+ | | <code>Abandon:TThreadAbandon;</code> | ||
+ | | Abandon function to call if any threads are waiting when Messageslot is destroyed | ||
+ | |- | ||
+ | |colspan="2"|''Internal Properties'' | ||
+ | |- | ||
+ | | <code>Prev:PMessageslotEntry;</code> | ||
+ | | Previous entry in Messageslot table | ||
+ | |- | ||
+ | | <code>Next:PMessageslotEntry;</code> | ||
+ | | Next entry in Messageslot table | ||
+ | |- | ||
+ | |colspan="2"|''Statistics Properties'' | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Mailslot entry''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PMailslotEntry = ^TMailslotEntry;</code> | ||
+ | |||
+ | <code>TMailslotEntry = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|''Mailslot Properties'' | ||
+ | |- | ||
+ | | <code>Signature:LongWord;</code> | ||
+ | | Signature for entry validation | ||
+ | |- | ||
+ | | <code>Maximum:LongWord;</code> | ||
+ | | Maximum number of messages in Mailslot | ||
+ | |- | ||
+ | | <code>Count:LongWord;</code> | ||
+ | | Current number of messages in Mailslot | ||
+ | |- | ||
+ | | <code>Start:LongWord;</code> | ||
+ | | First message available in Mailslot | ||
+ | |- | ||
+ | | <code>Lock:TSpinHandle;</code> | ||
+ | | Mailslot Lock | ||
+ | |- | ||
+ | | <code>Sender:TSemaphoreHandle;</code> | ||
+ | | Mailslot send Semaphore | ||
+ | |- | ||
+ | | <code>Receiver:TSemaphoreHandle;</code> | ||
+ | | Mailslot receive Semaphore | ||
+ | |- | ||
+ | | <code>Messages:PInteger;</code> | ||
+ | | Mailslot message queue | ||
+ | |- | ||
+ | |colspan="2"|''Internal Properties'' | ||
+ | |- | ||
+ | | <code>Prev:PMailslotEntry;</code> | ||
+ | | Previous entry in Mailslot table | ||
+ | |- | ||
+ | | <code>Next:PMailslotEntry;</code> | ||
+ | | Next entry in Mailslot table | ||
+ | |- | ||
+ | |colspan="2"|''Statistics Properties'' | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Buffer entry''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PBufferEntry = ^TBufferEntry;</code> | ||
+ | |||
+ | <code>TBufferEntry = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|''Buffer Properties'' | ||
+ | |- | ||
+ | | <code>Signature:LongWord;</code> | ||
+ | | Signature for entry validation | ||
+ | |- | ||
+ | | <code>Size:LongWord;</code> | ||
+ | | Size of each buffer | ||
+ | |- | ||
+ | | <code>Count:LongWord;</code> | ||
+ | | Number of buffers | ||
+ | |- | ||
+ | | <code>Flags:LongWord;</code> | ||
+ | | Buffer Flags (eg BUFFER_FLAG_SHARED) | ||
+ | |- | ||
+ | | <code>Lock:TSpinHandle;</code> | ||
+ | | Buffer Lock | ||
+ | |- | ||
+ | | <code>Available:TSemaphoreHandle;</code> | ||
+ | | Buffer available Semaphore | ||
+ | |- | ||
+ | | <code>Buffers:PBufferItem;</code> | ||
+ | | Buffer list | ||
+ | |- | ||
+ | |colspan="2"|''Internal Properties'' | ||
+ | |- | ||
+ | | <code>Prev:PBufferEntry;</code> | ||
+ | | Previous entry in Buffer table | ||
+ | |- | ||
+ | | <code>Next:PBufferEntry;</code> | ||
+ | | Next entry in Buffer table | ||
+ | |- | ||
+ | | <code>First:PBufferItem;</code> | ||
+ | | First available buffer item | ||
+ | |- | ||
+ | |colspan="2"|''Statistics Properties'' | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Buffer item''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PBufferItem = ^TBufferItem;</code> | ||
+ | |||
+ | <code>TBufferItem = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>Parent:TBufferHandle;</code> | ||
+ | | Handle of Buffer owning this item | ||
+ | |- | ||
+ | | <code>Next:PBufferItem;</code> | ||
+ | | Next item in list | ||
+ | |- | ||
+ | | <code>Buffer:Pointer;</code> | ||
+ | | Pointer to item data | ||
+ | |- | ||
+ | | <code>Reserved:LongWord;</code> | ||
+ | | Align to 16 bytes | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Event entry''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PEventEntry = ^TEventEntry;</code> | ||
+ | |||
+ | <code>TEventEntry = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|''Event Properties'' | ||
+ | |- | ||
+ | | <code>Signature:LongWord;</code> | ||
+ | | Signature for entry validation | ||
+ | |- | ||
+ | | <code>State:LongWord;</code> | ||
+ | | State of the event (Signaled/Unsignaled) | ||
+ | |- | ||
+ | | <code>Flags:LongWord;</code> | ||
+ | | Event Flags (eg EVENT_FLAG_MANUAL) | ||
+ | |- | ||
+ | | <code>Lock:TSpinHandle;</code> | ||
+ | | Event Lock | ||
+ | |- | ||
+ | | <code>List:TListHandle;</code> | ||
+ | | List of threads waiting on this Event (or INVALID_HANDLE_VALUE if never used) | ||
+ | |- | ||
+ | | <code>Wait:TThreadWait;</code> | ||
+ | | Wait function to call to wait on the Event if it is not Signaled | ||
+ | |- | ||
+ | | <code>WaitEx:TThreadWaitEx;</code> | ||
+ | | Wait function to call to wait with timeout on the Event if it is not Signaled | ||
+ | |- | ||
+ | | <code>Release:TThreadRelease;</code> | ||
+ | | Release function to call if any threads are waiting when Event is Signaled | ||
+ | |- | ||
+ | | <code>Abandon:TThreadAbandon;</code> | ||
+ | | Abandon function to call if any threads are waiting when Event is destroyed | ||
+ | |- | ||
+ | |colspan="2"|''Internal Properties'' | ||
+ | |- | ||
+ | | <code>Prev:PEventEntry;</code> | ||
+ | | Previous entry in Event table | ||
+ | |- | ||
+ | | <code>Next:PEventEntry;</code> | ||
+ | | Next entry in Event table | ||
+ | |- | ||
+ | |colspan="2"|''Statistics Properties'' | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Timer list''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PTimerList = ^TTimerList;</code> | ||
+ | |||
+ | <code>TTimerList = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|''List Properties'' | ||
+ | |- | ||
+ | | <code>Count:LongWord;</code> | ||
+ | | Count of items currently in the Timer list | ||
+ | |- | ||
+ | | <code>Flags:LongWord;</code> | ||
+ | | Timer list Flags (eg LOCK_FLAG_IRQ) | ||
+ | |- | ||
+ | | <code>Lock:TSpinHandle;</code> | ||
+ | | Timer list Lock | ||
+ | |- | ||
+ | | <code>First:PTimerItem;</code> | ||
+ | | First item in Timer list | ||
+ | |- | ||
+ | | <code>Last:PTimerItem;</code> | ||
+ | | Last item in Timer list | ||
+ | |- | ||
+ | |colspan="2"|''Internal Properties'' | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |colspan="2"|''Statistics Properties'' | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Timer item''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PTimerItem = ^TTimerItem;</code> | ||
+ | |||
+ | <code>TTimerItem = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>Key:Integer;</code> | ||
+ | | Ordering key for Timer list | ||
+ | |- | ||
+ | | <code>Timer:TTimerHandle;</code> | ||
+ | | The timer referenced by this Timer list item | ||
+ | |- | ||
+ | | <code>Prev:PTimerItem;</code> | ||
+ | | Previous item in Timer list | ||
+ | |- | ||
+ | | <code>Next:PTimerItem;</code> | ||
+ | | Next item in Timer list | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Timer entry''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PTimerEntry = ^TTimerEntry;</code> | ||
+ | |||
+ | <code>TTimerEntry = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|''Timer Properties'' | ||
+ | |- | ||
+ | | <code>Signature:LongWord;</code> | ||
+ | | Signature for entry validation | ||
+ | |- | ||
+ | | <code>Interval:LongWord;</code> | ||
+ | | Interval for timer (Milliseconds) | ||
+ | |- | ||
+ | | <code>State:LongWord;</code> | ||
+ | | State of the timer (Enabled/Disabled) | ||
+ | |- | ||
+ | | <code>Flags:LongWord;</code> | ||
+ | | Timer Flags (eg TIMER_FLAG_RESCHEDULE) | ||
+ | |- | ||
+ | | <code>Lock:TSpinHandle;</code> | ||
+ | | Timer Lock | ||
+ | |- | ||
+ | | <code>Event:TTimerEvent;</code> | ||
+ | | Function to call when timer triggers | ||
+ | |- | ||
+ | | <code>Data:Pointer;</code> | ||
+ | | Data to pass to function when timer triggers | ||
+ | |- | ||
+ | |colspan="2"|''Internal Properties'' | ||
+ | |- | ||
+ | | <code>TimerList:PTimerList;</code> | ||
+ | | The timer list this timer is currently in (or nil) | ||
+ | |- | ||
+ | | <code>TimerItem:TTimerItem;</code> | ||
+ | | Timer list item for this timer when in a Timer list | ||
+ | |- | ||
+ | | <code>Prev:PTimerEntry;</code> | ||
+ | | Previous entry in Timer table | ||
+ | |- | ||
+ | | <code>Next:PTimerEntry;</code> | ||
+ | | Next entry in Timer table | ||
+ | |- | ||
+ | |colspan="2"|''Statistics Properties'' | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Worker request''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PWorkerRequest = ^TWorkerRequest;</code> | ||
+ | |||
+ | <code>TWorkerRequest = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|''Worker Properties'' | ||
+ | |- | ||
+ | | <code>Signature:LongWord;</code> | ||
+ | | Signature for entry validation | ||
+ | |- | ||
+ | | <code>Interval:LongWord;</code> | ||
+ | | Interval for worker (Milliseconds) | ||
+ | |- | ||
+ | | <code>Flags:LongWord;</code> | ||
+ | | Worker Flags (eg WORKER_FLAG_RESCHEDULE) | ||
+ | |- | ||
+ | | <code>Lock:TSpinHandle;</code> | ||
+ | | Worker Lock (or INVALID_HANDLE_VALUE if Interval is 0 and Flags is not WORKER_FLAG_RESCHEDULE) | ||
+ | |- | ||
+ | | <code>Timer:TTimerHandle;</code> | ||
+ | | Worker Timer (or INVALID_HANDLE_VALUE if Interval is 0) | ||
+ | |- | ||
+ | | <code>Task:TWorkerTask;</code> | ||
+ | | Task to call by worker | ||
+ | |- | ||
+ | | <code>Data:Pointer;</code> | ||
+ | | Data to pass to task | ||
+ | |- | ||
+ | | <code>Callback:TWorkerCallback;</code> | ||
+ | | Callback when task is completed | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Tasker list''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PTaskerList = ^TTaskerList;</code> | ||
+ | |||
+ | <code>TTaskerList = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|''List Properties'' | ||
+ | |- | ||
+ | | <code>Count:LongWord;</code> | ||
+ | | Count of tasks currently in the Tasker list | ||
+ | |- | ||
+ | | <code>Lock:TSpinHandle;</code> | ||
+ | | Tasker list Lock | ||
+ | |- | ||
+ | | <code>First:PTaskerTask;</code> | ||
+ | | First task in Tasker list | ||
+ | |- | ||
+ | | <code>Last:PTaskerTask;</code> | ||
+ | | Last task in Tasker list | ||
+ | |- | ||
+ | |colspan="2"|''Internal Properties'' | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |colspan="2"|''Statistics Properties'' | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Tasker task''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PTaskerTask = ^TTaskerTask;</code> | ||
+ | |||
+ | <code>TTaskerTask = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>Task:LongWord;</code> | ||
+ | | The task to be performed | ||
+ | |- | ||
+ | | <code>Prev:PTaskerTask;</code> | ||
+ | | Previous task in Tasker list | ||
+ | |- | ||
+ | | <code>Next:PTaskerTask;</code> | ||
+ | | Next task in Tasker list | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Tasker thread send message''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PTaskerThreadSendMessage = ^TTaskerThreadSendMessage;</code> | ||
+ | |||
+ | <code>TTaskerThreadSendMessage = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>Task:LongWord;</code> | ||
+ | | The task to be performed | ||
+ | |- | ||
+ | | <code>Prev:PTaskerTask;</code> | ||
+ | | Previous task in Tasker list | ||
+ | |- | ||
+ | | <code>Next:PTaskerTask;</code> | ||
+ | | Next task in Tasker list | ||
+ | |- | ||
+ | |colspan="2"|''Internal Properties'' | ||
+ | |- | ||
+ | | <code>Thread:TThreadHandle;</code> | ||
+ | | Handle of the thread to send a message to | ||
+ | |- | ||
+ | | <code>Message:TMessage;</code> | ||
+ | | Message to send to the thread | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Tasker message slot send''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PTaskerMessageslotSend = ^TTaskerMessageslotSend;</code> | ||
+ | |||
+ | <code>TTaskerMessageslotSend = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>Task:LongWord;</code> | ||
+ | | The task to be performed | ||
+ | |- | ||
+ | | <code>Prev:PTaskerTask;</code> | ||
+ | | Previous task in Tasker list | ||
+ | |- | ||
+ | | <code>Next:PTaskerTask;</code> | ||
+ | | Next task in Tasker list | ||
+ | |- | ||
+ | |colspan="2"|''Internal Properties'' | ||
+ | |- | ||
+ | | <code>Messageslot:TMessageslotHandle;</code> | ||
+ | | Handle of the message slot to send to | ||
+ | |- | ||
+ | | <code>Message:TMessage;</code> | ||
+ | | Message to be sent | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Tasker semaphore signal''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PTaskerSemaphoreSignal = ^TTaskerSemaphoreSignal;</code> | ||
+ | |||
+ | <code>TTaskerSemaphoreSignal = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>Task:LongWord;</code> | ||
+ | | The task to be performed | ||
+ | |- | ||
+ | | <code>Prev:PTaskerTask;</code> | ||
+ | | Previous task in Tasker list | ||
+ | |- | ||
+ | | <code>Next:PTaskerTask;</code> | ||
+ | | Next task in Tasker list | ||
+ | |- | ||
+ | |colspan="2"|''Internal Properties'' | ||
+ | |- | ||
+ | | <code>Semaphore:TSemaphoreHandle;</code> | ||
+ | | Handle of the semaphore to signal | ||
+ | |- | ||
+ | | <code>Count:LongWord;</code> | ||
+ | | The count to be signalled | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Thread info''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PThreadInfo = ^TThreadInfo;</code> | ||
+ | |||
+ | <code>TThreadInfo = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>ThreadFunction:TThreadFunc;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>ThreadParameter:Pointer;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>StackLength:Cardinal;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''CPU start''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TCPUStart = procedure(CPUID:LongWord);</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Primary initialization''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TPrimaryInit = procedure;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Scheduler initialization''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TSchedulerInit = procedure;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Scheduler start''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TSchedulerStart = procedure(CPUID:LongWord);</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Secondary initialization''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TSecondaryInit = procedure;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Secondary boot''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TSecondaryBoot = procedure(CPUID:LongWord);</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Spin lock''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TSpinLock = function(Spin:PSpinEntry):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Spin unlock''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TSpinUnlock = function(Spin:PSpinEntry):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Spin lock IRQ''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TSpinLockIRQ = function(Spin:PSpinEntry):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Spin unlock IRQ''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TSpinUnlockIRQ = function(Spin:PSpinEntry):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Spin lock FIQ''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TSpinLockFIQ = function(Spin:PSpinEntry):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Spin unlock FIQ''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TSpinUnlockFIQ = function(Spin:PSpinEntry):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Spin lock IRQ/FIQ''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TSpinLockIRQFIQ = function(Spin:PSpinEntry):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Spin unlock IRQ/FIQ''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TSpinUnlockIRQFIQ = function(Spin:PSpinEntry):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Spin check IRQ''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TSpinCheckIRQ = function(Spin:PSpinEntry):Boolean;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Spin check FIQ''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TSpinCheckFIQ = function(Spin:PSpinEntry):Boolean;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Spin exchange IRQ''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TSpinExchangeIRQ = function(Spin1,Spin2:PSpinEntry):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Spin exchange FIQ''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TSpinExchangeFIQ = function(Spin1,Spin2:PSpinEntry):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Spin mask exchange''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TSpinMaskExchange = function(Spin1,Spin2:PSpinEntry):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Mutex lock''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TMutexLock = function(Mutex:PMutexEntry):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Mutex unlock''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TMutexUnlock = function(Mutex:PMutexEntry):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Mutex try lock''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TMutexTryLock = function(Mutex:PMutexEntry):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Critical section lock''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TCriticalSectionLock = function(CriticalSection:PCriticalSectionEntry):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Critical section lock ex''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TCriticalSectionLockEx = function(CriticalSection:PCriticalSectionEntry; Timeout:LongWord):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Critical section unlock''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TCriticalSectionUnlock = function(CriticalSection:PCriticalSectionEntry):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Critical section try lock''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TCriticalSectionTryLock = function(CriticalSection:PCriticalSectionEntry):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Semaphore wait''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TSemaphoreWait = function(Semaphore:PSemaphoreEntry):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Semaphore wait ex''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TSemaphoreWaitEx = function(Semaphore:PSemaphoreEntry; Timeout:LongWord):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Semaphore signal''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TSemaphoreSignal = function(Semaphore:PSemaphoreEntry):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Synchronizer lock''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TSynchronizerLock = function(Synchronizer:PSynchronizerEntry):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Synchronizer lock ex''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TSynchronizerLockEx = function(Synchronizer:PSynchronizerEntry; Timeout:LongWord):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Synchronizer unlock''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TSynchronizerUnlock = function(Synchronizer:PSynchronizerEntry):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Synchronizer convert''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TSynchronizerConvert = function(Synchronizer:PSynchronizerEntry):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Synchronizer convert ex''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TSynchronizerConvertEx = function(Synchronizer:PSynchronizerEntry; Timeout:LongWord):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Messageslot send''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TMessageslotSend = function(Messageslot:PMessageslotEntry; Message:PMessage):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Messageslot receive''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TMessageslotReceive = function(Messageslot:PMessageslotEntry; Message:PMessage):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Messageslot receive ex''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TMessageslotReceiveEx = function(Messageslot:PMessageslotEntry; Message:PMessage; Timeout:LongWord):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Mailslot send''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TMailslotSend = function(Mailslot:PMailslotEntry; Data:Integer):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Mailslot send ex''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TMailslotSendEx = function(Mailslot:PMailslotEntry; Data:Integer; Timeout:LongWord):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Mailslot receive''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TMailslotReceive = function(Mailslot:PMailslotEntry):Integer;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Mailslot receive ex''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TMailslotReceiveEx = function(Mailslot:PMailslotEntry; Timeout:LongWord):Integer;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Buffer get''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TBufferGet = function(Buffer:PBufferEntry):Pointer;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Buffer get ex''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TBufferGetEx = function(Buffer:PBufferEntry; Timeout:LongWord):Pointer;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Buffer free''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TBufferFree = function(Buffer:Pointer):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Buffer iterate''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TBufferIterate = function(Buffer:PBufferEntry; Previous:Pointer):Pointer;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Event wait''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TEventWait = function(Event:PEventEntry):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Event wait ex''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TEventWaitEx = function(Event:PEventEntry; Timeout:LongWord):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Event set''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TEventSet = function(Event:PEventEntry):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Event reset''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TEventReset = function(Event:PEventEntry):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Event pulse''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TEventPulse = function(Event:PEventEntry):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Timer enable''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TTimerEnable = function(Timer:PTimerEntry):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Timer enable ex''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TTimerEnableEx = function(Timer:PTimerEntry; Interval:LongWord; Event:TTimerEvent; Data:Pointer):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Timer disable''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TTimerDisable = function(Timer:PTimerEntry):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Timer check''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TTimerCheck = function:LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''TImer trigger''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TTimerTrigger = function:LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Tasker check''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TTaskerCheck = function:LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Tasker trigger''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TTaskerTrigger = function:LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Thread get current''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TThreadGetCurrent = function:TThreadHandle;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Thread set current''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TThreadSetCurrent = function(Thread:TThreadHandle):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Thread start''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TThreadStart = function(Parameter:Pointer):PtrInt;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Thread end''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TThreadEnd = procedure(ExitCode:LongWord);</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Scheduler check''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TSchedulerCheck = function(CPUID:LongWord):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Scheduler wakeup''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TSchedulerWakeup = function(CPUID:LongWord):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Scheduler expire''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TSchedulerExpire = function(CPUID:LongWord):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Scheduler switch''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TSchedulerSwitch = function(CPUID:LongWord; Thread:TThreadHandle):TThreadHandle;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Scheduler select''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TSchedulerSelect = function(CPUID:LongWord; Thread:TThreadHandle; Yield:Boolean):TThreadHandle;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Scheduler reschedule''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TSchedulerReschedule = function (Yield:Boolean):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Scheduler migration enable''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TSchedulerMigrationEnable = function:LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Scheduler migration disable''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TSchedulerMigrationDisable = function:LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Scheduler preempt enable''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TSchedulerPreemptEnable = function(CPUID:LongWord):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Scheduler preempt disable''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TSchedulerPreemptDisable = function(CPUID:LongWord):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Scheduler allocation enable''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TSchedulerAllocationEnable = function(CPUID:LongWord):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Scheduler allocation disable''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TSchedulerAllocationDisable = function(CPUID:LongWord):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Thread setup stack''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TThreadSetupStack = function(StackBase:Pointer; StartProc:TThreadStart; ReturnProc:TThreadEnd; Parameter:Pointer):Pointer;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | <br /> | ||
=== Public variables === | === Public variables === |
Revision as of 01:25, 26 January 2017
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 synchronise 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 releaseing 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 Hierachy -
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 aquiring 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 behavious then you must use SpinExchangeIRQ(or FIQ)() when holding both locks in order to reverse the order of the IRQ or FIQ renabling.
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 exlusive 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.
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.
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.
Constants
LOCK_FLAG_*
SPIN_*
SPIN_STATE_*
MUTEX_*
MUTEX_STATE_*
MUTEX_FLAG_*
CRITICAL_SECTION_*
CRITICAL_SECTION_STATE_*
SEMAPHORE_*
SEMAPHORE_FLAG_*
SYNCHRONIZER_*
SYNCHRONIZER_STATE_*
SYNCHRONIZER_FLAG_*
LIST_*
LIST_TYPE_*
LIST_FLAG_*
QUEUE_*
QUEUE_TYPE_*
QUEUE_FLAG_*
QUEUE_KEY_*
THREAD_*
THREAD_TYPE_*
THREAD_STATE_*
THREAD_PRIORITY_*
THREAD_NAME_*
*_THREAD_PRIORITY
THREAD_CREATE_*
THREAD_TLS_*
THREAD_TLS_FLAG_*
THREAD_LISTS_*
MESSAGESLOT_*
MESSAGESLOT_FLAG_*
MAILSLOT_*
BUFFER_*
BUFFER_FLAG_*
EVENT_*
EVENT_STATE_*
EVENT_FLAG_*
TIMER_*
TIMER_STATE_*
TIMER_FLAG_*
TIMER_KEY_*
WORKER_*
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
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 message slot 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;
|
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) |
Heap manager variables
HeapLock:THeapLock;
|
RTL thread manager variables
ThreadVarBlockSize:DWORD;
|
Inititalization 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;
|
Messageslot Send/Receive handlers
MessageslotSendHandler:TMessageslotSend;
|
MessageslotReceiveHandler:TMessageslotReceive;
|
MessageslotReceiveExHandler:TMessageslotReceiveEx;
|
Mailslot Send/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 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 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;
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 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 MutexCount(Mutex:TMutexHandle):LongWord;
function MutexOwner(Mutex:TMutexHandle):TThreadHandle;
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;
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 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 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;
function ThreadSetLastError(LastError:LongWord):LongWord;
function ThreadGetWaitResult:LongWord;
function ThreadGetReceiveResult:LongWord;
function ThreadAllocTlsIndex:LongWord;
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;
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;
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;
Return to Unit Reference