Difference between revisions of "Unit Threads"
(Created page with "Return to Unit Reference === Description === ---- ''To be documented'' === Constants === ---- ''To be documented'' === Type definitions === ---- ''To...") |
|||
(197 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
---- | ---- | ||
− | ''To be documented'' | + | '''Ultibo Threads Interface unit''' |
+ | |||
+ | '''LOCKING PRIMITIVES''' | ||
+ | |||
+ | '''Spin''' - | ||
+ | |||
+ | A simple spin lock for fast mutually exclusive access to data. Threads "spin" while waiting to acquire the lock and do not yield the CPU unless pre-empted. | ||
+ | |||
+ | Non recursive (can only be acquired once by the same thread) | ||
+ | |||
+ | Includes IRQ/FIQ entry and exit routines to Save/Restore the IRQ/FIQ state. | ||
+ | |||
+ | Suitable for use by Interrupt handlers if non interrupt callers use the IRQ/FIQ entry and exit routines to Lock and Unlock. | ||
+ | |||
+ | Suitable for use on multiprocessor systems if the lock is allocated from shared memory (Determined during initialization). | ||
+ | |||
+ | Not recommended for long held operations or holding during I/O operations. | ||
+ | |||
+ | Access is not serialized, the next thread to try obtaining the lock when it is released will succeed even if that thread was not the first waiting. | ||
+ | |||
+ | '''''Usage:''''' | ||
+ | |||
+ | ''Create/Destroy'' | ||
+ | |||
+ | Spin locks are created using SpinCreate() and destroyed using SpinDestroy(), these functions should not be called from within an Interrupt handler. Lock/Unlock (Data accessed only by threads) | ||
+ | |||
+ | To synchronize data access between threads each thread should call SpinLock() before accessing the data and SpinUnlock() when finished accessing the data. These calls do not affect the state of IRQs or FIQs and therefore do not impact interrupt latency. Lock/Unlock (Data accessed by threads and interrupt handlers) | ||
+ | |||
+ | To use a Spin lock to synchronize data access between threads and an interrupt handler each thread should call SpinLockIRQ() or SpinLockFIQ(), depending on whether the interrupt handler is servicing IRQ or FIQ requests, before accessing the data and SpinUnlockIRQ() or SpinUnlockFIQ() when finished accessing the data. These calls disable interrupts before acquiring the lock (with deadlock protection) and restore interrupts after releasing the lock and therefore should only be used to protect very short sections of code accessing shared data to minimize the impact on interrupt latency. | ||
+ | |||
+ | Interrupt handlers should call SpinLock() before accessing the data and SpinUnlock() when finished accessing the data. In a Uniprocessor system it is technically not necessary for interrupt handlers to call lock/unlock as the use of IRQ/FIQ disable/enable will prevent interrupt handlers from executing while a thread has the lock. On a Multiprocessor system however interrupt handlers can execute on one processor while a thread is executing on another (which will not deadlock), to correctly synchronize data access both threads and interrupt handlers should call the appropriate lock/unlock before and after access to the data. | ||
+ | |||
+ | '''Lock Hierarchy''' - | ||
+ | |||
+ | It is safe to acquire one lock using SpinLock() then another lock using SpinLock() and then release them in reverse order. | ||
+ | |||
+ | It is also safe to acquire one lock using SpinLock() then another lock using SpinLockIRQ(or FIQ)() and then release them in reverse order. | ||
+ | |||
+ | It is NOT safe to acquire one lock using SpinLockIRQ(or FIQ)() then another lock using SpinLock() and then release them in reverse order. This is because the first SpinLockIRQ(or FIQ)() can disable the scheduling and prevent thread preemption. If another thread is already holding the second lock then this sequence will deadlock (except on a multicore system where the other thread is running on a different CPU). | ||
+ | |||
+ | It is also safe to acquire one lock using SpinLockIRQ(or FIQ)() then another lock using SpinLockIRQ(or FIQ)() and then release them in reverse order. In this case you must ensure that any thread acquiring the second lock also calls SpinLockIRQ(or FIQ)() to thereby avoid the deadlock. | ||
+ | |||
+ | It is NOT safe to acquire one lock using SpinLockIRQ(or FIQ)() then another lock using SpinLockIRQ(or FIQ)() and then release them in the SAME order. If the situation absolutely requires this behaviour then you must use SpinExchangeIRQ(or FIQ)() when holding both locks in order to reverse the order of the IRQ or FIQ re-enabling. | ||
+ | |||
+ | '''Mutex''' - | ||
+ | |||
+ | A mutually exclusive lock for controlling access to data. Threads yield while waiting to acquire the lock. | ||
+ | |||
+ | Non recursive (can only be acquired once by the same thread) (Recursive if MUTEX_FLAG_RECURSIVE specified) | ||
+ | |||
+ | Not suitable for use by Interrupt handlers. | ||
+ | |||
+ | Suitable for use on multiprocessor systems if the lock is allocated from shared memory (Determined during initialization). | ||
+ | |||
+ | Recommended for long held operations or holding during I/O operations. | ||
+ | |||
+ | Access is not serialized, the next thread to try obtaining the lock when it is released will succeed even if that thread was not the first waiting. | ||
+ | |||
+ | '''''Usage:''''' | ||
+ | |||
+ | ''Create/Destroy'' | ||
+ | |||
+ | Mutex locks are created using MutexCreate() and destroyed using MutexDestroy(). The MutexCreateEx() function allows additional options to be specified including if the creating thread is the initial owner and flags such as MUTEX_FLAG_RECURSIVE. | ||
+ | |||
+ | ''Lock/Unlock'' | ||
+ | |||
+ | To use a Mutex lock to synchronise data access between threads each thread should call MutexLock() before accessing the data and MutexUnlock() when finished accessing the data. | ||
+ | |||
+ | The MutexTryLock() function will attempt to lock the Mutex but will return an error instead of waiting for it if already locked. | ||
+ | |||
+ | '''Lock Hierarchy''' - | ||
+ | |||
+ | It is safe to acquire one lock using MutexLock() then another lock using MutexLock() and then release them in reverse order. | ||
+ | |||
+ | It is also safe to acquire one lock using MutexLock() then another lock using MutexLock() and then release them in the SAME order. | ||
+ | |||
+ | It is safe to acquire a Mutex lock using MutexLock() then aquire a Spin lock using SpinLockIRQ(or FIQ)(). | ||
+ | |||
+ | It is NOT safe to acquire a Spin lock using SpinLockIRQ(or FIQ)() then acquire a Mutex lock using MutexLock(). | ||
+ | |||
+ | '''CriticalSection''' - | ||
+ | |||
+ | A mutually exclusive lock for serializing access to data. Threads are placed on a wait list while waiting to acquire the lock. | ||
+ | |||
+ | Recursive (can be acquired multiple times by the same thread) | ||
+ | |||
+ | Not suitable for use by Interrupt handlers. | ||
+ | |||
+ | Suitable for use on multiprocessor systems. | ||
+ | |||
+ | Recommended for long held operations or holding during I/O operations. | ||
+ | |||
+ | Access is serialized, the next thread to obtain the lock when it is released will be the thread that has been waiting longest (See also stolen wakeups below). | ||
+ | |||
+ | '''''Usage:''''' | ||
+ | |||
+ | ''Create/Destroy'' | ||
+ | |||
+ | Critical Sections are created using CriticalSectionCreate() and destroyed using CriticalSectionDestroy(). | ||
+ | |||
+ | The CriticalSectionCreateEx() function allows specifying additional flags and options for the lock. | ||
+ | |||
+ | ''Lock/Unlock'' | ||
+ | |||
+ | To use a Critical Section to synchronise data access between threads each thread should call CriticalSectionLock() before accessing the data and CriticalSectionUnlock() when finished accessing the data. A CriticalSectionTryLock() function is also available which will not wait if the lock is unavailable and will return immediately with an error. | ||
+ | |||
+ | Because Critical Sections place waiting threads on a wait list they also include the option to specify a timeout value so a thread will not wait indefinitely to obtain the lock by calling CriticalSectionLockEx(). | ||
+ | |||
+ | The CriticalSectionLockEx() function will return ERROR_SUCCESS if the lock was obtained, ERROR_WAIT_TIMEOUT if the timeout value elapsed before obtaining the lock and ERROR_WAIT_ABANDONED if waiting was abandoned because the lock was destroyed or another thread called ThreadAbandon() with the handle of the waiting thread. | ||
+ | |||
+ | It is critical that the return value be checked when using timeouts in order to be certain that the lock was obtained before accessing the protected data, failure to do so may result in data corruption if multiple threads make changes at the same time. | ||
+ | |||
+ | '''Lock Hierarchy''' - | ||
+ | |||
+ | All serialized locks and synchronization objects generally follow the same principles as Mutex locks above. | ||
+ | |||
+ | It is safe to acquire and release most combinations of serialized objects in any order except where doing so would create a deadlock between threads where thread 1 holds object A is waiting on object B and thread 2 holds object B and is waiting on object A. | ||
+ | |||
+ | In all cases it is NOT safe to attempt to acquire a serialized object while IRQ or FIQ are disabled such as after calling SpinLockIRQ(or FIQ)() | ||
+ | |||
+ | '''Semaphore''' - | ||
+ | |||
+ | A counted serialization object that allows threads to proceed until the count reaches zero after which threads will be made to wait until the count is increased by another thread (or interrupt handler) calling signal. | ||
+ | |||
+ | Suitable for use by Interrupt handlers for signaling only if created with SEMAPHORE_FLAG_IRQ or FIQ (Interrupt handlers must not call wait). | ||
+ | |||
+ | Suitable for use on multiprocessor systems. | ||
+ | |||
+ | Access is serialized, the next thread to acquire the semaphore when it is signaled will be the thread that has been waiting longest (See also stolen wakeups below). | ||
+ | |||
+ | '''''Usage:''''' | ||
+ | |||
+ | ''Create/Destroy'' | ||
+ | |||
+ | Semaphores are created using SemaphoreCreate() and destroyed using SemaphoreDestroy(). With additional flags and options available by calling SemaphoreCreateEx(). The initial count of the Semaphore must be specified when calling create, in many usages the count will begin at zero but any value required by the application can be specified. | ||
+ | |||
+ | ''Wait/Signal'' | ||
+ | |||
+ | Threads consume the available count (or wait for count to be available) by calling SemaphoreWait() or SemaphoreWaitEx() if a timeout value is required. | ||
+ | |||
+ | Threads (or interrupt handlers) signal available count by calling SemaphoreSignal() or SemaphoreSignalEx() which allows increasing the count by values greater than one. | ||
+ | |||
+ | '''Lock Hierarchy''' - | ||
+ | |||
+ | Similar rules apply to all other serialized objects except that Semaphores support passing the flag SEMAPHORE_FLAG_IRQ (or FIQ) to SemaphoreCreateEx() so that signalling via the SemaphoreSignal() functions may be called from an interrupt handler. | ||
+ | |||
+ | '''Synchronizer''' - | ||
+ | |||
+ | A reader/writer lock for serializing multiple concurrent reads and single writes to data. Threads are placed on a wait list while waiting to acquire the lock. | ||
+ | |||
+ | Recursive (reader lock can be acquired multiple times by the same thread or by other threads/writer lock can be acquired multiple times by the same thread). | ||
+ | |||
+ | Not suitable for use by Interrupt handlers. | ||
+ | |||
+ | Suitable for use on multiprocessor systems. | ||
+ | |||
+ | Recommended for long held operations or holding during I/O operations. | ||
+ | |||
+ | Access is serialized, the next thread to obtain the lock when it is released will be the thread that has been waiting longest (See also stolen wakeups below). | ||
+ | |||
+ | '''''Usage:''''' | ||
+ | |||
+ | ''Create/Destroy'' | ||
+ | |||
+ | Synchronizers are created using SynchronizerCreate() or SynchronizerCreateEx() and destroyed using SynchronizerDestroy(). | ||
+ | |||
+ | ''Lock/Unlock'' | ||
+ | |||
+ | Threads wanting read access to the protected data call SynchronizerReaderLock() and SynchronizerReaderUnlock() to obtain and release the lock. While one or more threads holds the reader lock no thread can obtain the writer lock. | ||
+ | |||
+ | A thread holding the reader lock can convert it to the writer lock by calling SynchronizerReaderConvert() but if any other thread is also holding the reader lock it will be placed in a wait list to wait until all threads have released the reader lock. | ||
+ | |||
+ | Threads wanting write access to the protected data call SynchronizerWriterLock() and SynchronizerWriterUnlock() to obtain and release the lock. While any thread holds the writer lock no thread can obtain the reader lock. | ||
+ | |||
+ | A thread holding the writer lock can convert it to the reader lock by calling SynchronizerWriterConvert(), because the writer lock is exclusive the thread will always obtain the reader lock immediately. All other threads currently waiting for the reader lock will also be released and given access. | ||
+ | |||
+ | Extended versions of the lock and convert functions for both reader and writer locks are available which allow specifying a timeout value to give up waiting after a specified time. | ||
+ | |||
+ | '''Lock Hierarchy''' - | ||
+ | |||
+ | The rules for Synchronizers are the same as those that apply to other serialized objects such as CriticalSection. | ||
+ | |||
+ | '''Condition''' - | ||
+ | |||
+ | A condition variable is used for coordinating synchronized access to resources by multiple threads. Condition variables are similar in concept to both Semaphores and Events but do not retain any internal state information so threads always wait until they are woken or the specified timeout interval expires. | ||
+ | |||
+ | Not suitable for use by Interrupt handlers. | ||
+ | |||
+ | Suitable for use on multiprocessor systems. | ||
+ | |||
+ | Access is serialized, the next thread released when a condition is woken will be the thread that has been waiting longest (See also stolen wakeups below). | ||
+ | |||
+ | '''''Usage:''''' | ||
+ | |||
+ | ''Create/Destroy'' | ||
+ | |||
+ | Conditions are created using ConditionCreate() and destroyed using ConditionDestroy(). | ||
+ | |||
+ | ''Wait/Wake'' | ||
+ | |||
+ | Threads call ConditionWait() to begin waiting for the condition to be woken, additional versions of wait exist that allow releasing another lock before waiting and reacquiring it when the thread is woken after waiting. | ||
+ | |||
+ | These are ConditionWaitMutex(), ConditionWaitSynchronizer(), ConditionWaitCriticalSection() which apply to Mutex, Synchronizer and CriticalSection objects respectively. | ||
+ | |||
+ | Calling ConditionWake() will release one thread that is currently waiting for the condition, the ConditionWakeAll() function will release all threads waiting for the condition. | ||
+ | |||
+ | '''Lock Hierarchy''' - | ||
+ | |||
+ | The rules for Conditions are the same as those that apply to other serialized objects such as CriticalSection and Synchronizers. | ||
+ | |||
+ | '''Completion''' - | ||
+ | |||
+ | A completion is similar in concept to both condition variables and events but behaves differently to each of them. Completions are designed to be similar to the Linux synchronization object of the same name and provide a light weight mechanism for allowing one or more threads to wait for a signal that they can proceed. The completion differs from a condition variable because it maintains an internal state, once the state has been set (complete) threads pass through the completion without waiting (until the state is reset). This is similar to an event (see below) but in the case of a completion the state remains set indefinitely or until reset is called, a completion also allows explicitly releasing one thread at a time or all threads at once. More generally the event was created to model a behaviour that is similar to the same object in Windows and the completion models the Linux object instead. | ||
+ | |||
+ | Completions can use a counted state rather than a single state if they are created with COMPLETION_FLAG_COUNTED, this is to mimic the implementation of the Linux variation however there is a slight but important change in the way counted completions are implemented in Ultibo. The Linux completion sets the count to UMAX_INT / 2 on complete_all() which is documented as "effectively infinite". This is of course incorrect and seriously flawed because the count value is only set to a little over 2 billion, a long running application could easily consume this count with calls to wait_for_completion() and then the application would potentially fail without explanation. | ||
+ | |||
+ | To prevent this same fatal flaw the Ultibo implementation sets the count at LongWord(-1) on CompletionCompleteAll() and all other operations check for this value before incrementing or decrementing the count further. In this way the setting of complete all is genuinely infinite and will not fail on a long running application. | ||
+ | |||
+ | Suitable for use by Interrupt handlers to call complete or reset only if created with COMPLETION_FLAG_IRQ or FIQ (Interrupt handlers must not call wait). | ||
+ | |||
+ | Suitable for use on multiprocessor systems. | ||
+ | |||
+ | Access is serialized, the next thread released when a completion is set will be the thread that has been waiting longest (See also stolen wakeups below). | ||
+ | |||
+ | '''''Usage:''''' | ||
+ | |||
+ | ''Create/Destroy'' | ||
+ | |||
+ | Completions are created using CompletionCreate() and destroyed using CompletionDestroy(). | ||
+ | |||
+ | ''Wait/Reset/Complete'' | ||
+ | |||
+ | Threads call CompletionWait() to either wait for a completion to be set or proceed immediately if it is already set, for counted completions the count is decremented (if not -1) and if the count reaches 0 the state of the completion is reset. A CompletionTryWait() function is available to check the state and return immediately with an error if not set. | ||
+ | |||
+ | Threads (or interrupt handlers) set or reset the state of the completion by calling CompletionComplete(), CompletionReset() or CompletionCompleteAll(). | ||
+ | |||
+ | See the header of each function for a detailed description of the behaviour in all applicable cases. | ||
+ | |||
+ | '''Lock Hierarchy''' - | ||
+ | |||
+ | The rules for Completions are the same as those that apply to other serialized objects such as CriticalSection and Synchronizers except that like Semaphores they may be signalled by interrupt handlers if the appropriate flags as passed to create. | ||
+ | |||
+ | '''THREAD HANDLING''' | ||
+ | |||
+ | '''List''' - | ||
+ | |||
+ | A linked list designed to provide the wait list functionality for threads, each thread record includes a list element and the list elements include a thread handle to allow resolution in both directions. Lists are used by all serialized objects to hold threads in an ordered wait list that can be safely manipulated in all scheduling states. | ||
+ | |||
+ | Lists are primarily intended to be used internally but are available for use by applications for appropriate cases. | ||
+ | |||
+ | Suitable for use by Interrupt handlers if created with appropriate flags. | ||
+ | |||
+ | Suitable for use on multiprocessor systems. | ||
+ | |||
+ | '''''Usage:''''' | ||
+ | |||
+ | ''Create/Destroy'' | ||
+ | |||
+ | Lists are created using ListCreate() or ListCreateEx() and destroyed using ListDestroy(). | ||
+ | |||
+ | ''Add/Get/Insert/Remove'' | ||
+ | |||
+ | A complete set of functions exist for adding, removing and inserting elements into a list and for finding threads within a list. | ||
+ | |||
+ | See the header of each of the functions in the appropriate section below for more information. | ||
+ | |||
+ | ''Lock/Unlock'' | ||
+ | |||
+ | A pair of universal lock and unlock functions exist to acquire and release list locks with the appropriate IRQ (or FIQ) handling for the flags the list was created with. See ListLock() and ListUnlock() below for more information. | ||
+ | |||
+ | '''Queue''' - | ||
+ | |||
+ | An ordered linked list designed to provide scheduler queues for threads, each thread record includes a queue element and the queue elements include a thread handle to allow resolution in both directions. | ||
+ | |||
+ | Queues are primarily intended to be used internally but are available for use by applications for appropriate cases. | ||
+ | |||
+ | Suitable for use by Interrupt handlers if created with appropriate flags. | ||
+ | |||
+ | Suitable for use on multiprocessor systems. | ||
+ | |||
+ | '''''Usage:''''' | ||
+ | |||
+ | ''Create/Destroy'' | ||
+ | |||
+ | Queues are created using QueueCreate() or QueueCreateEx() and destroyed using QueueDestroy(). | ||
+ | |||
+ | ''Enqueue/Dequeue/Insert/Delete/Increment/Decrement'' | ||
+ | |||
+ | A range of functions exist for adding, removing and inserting elements into a queue and for managing the elements within a queue. | ||
+ | |||
+ | See the header of each of the functions in the appropriate section below for more information. | ||
+ | |||
+ | ''Lock/Unlock'' | ||
+ | |||
+ | A pair of universal lock and unlock functions exist to acquire and release queue locks with the appropriate IRQ (or FIQ) handling for the flags the queue was created with. See QueueLock() and QueueUnlock() below for more information. | ||
+ | |||
+ | '''Message''' - | ||
+ | |||
+ | A simple record similar to the Windows MSG structure the TMessage contains fields whose purpose is opaque to the core of Ultibo and can be used for passing any type of information between threads or through other mechanisms. | ||
+ | |||
+ | No functions explicity exist to deal with messages, however they are used as the format for thread messages and are the record that is passed to ThreadSendMessage() and received from ThreadReceiveMessage(). Messages are also used as the record format for Messageslots (see below). | ||
+ | |||
+ | '''Thread''' - | ||
+ | |||
+ | Threads form the primary unit of code execution in Ultibo. It is not possible to create processes which run in their own protected address space, all threads run within the kernel and with full privilege so they can perform any operation required. The core of Ultibo always includes threading and multiple threads are created during the boot process to perform system critical functions. | ||
+ | |||
+ | The complete set of available thread functions are listed below and the header of each one includes more information including any important notes or restrictions to be aware of. | ||
+ | |||
+ | '''ADDITIONAL ITEMS''' | ||
+ | |||
+ | '''Messageslot''' - | ||
+ | |||
+ | The Messageslot allows multiple threads to wait on a single object for messages received from other sources. Where the thread message functions such as ThreadReceiveMessage() only allow a single thread to receive the message many threads can wait simultaneously on a Messageslot and will be woken in turn as new messages are received. | ||
+ | |||
+ | Suitable for use by Interrupt handlers for sending only if created with MESSAGESLOT_FLAG_IRQ or FIQ (Interrupt handlers must not call receive). | ||
+ | |||
+ | Suitable for use on multiprocessor systems. | ||
+ | |||
+ | '''''Usage:''''' | ||
+ | |||
+ | ''Create/Destroy'' | ||
+ | |||
+ | Messageslots are created using MessageslotCreate() or MessageslotCreateEx() and destroyed using MessageslotDestroy(). | ||
+ | |||
+ | ''Send/Receive'' | ||
+ | |||
+ | Threads wait for messages by calling MessageslotReceive() or MessageslotReceiveEx() to wait with a timeout. | ||
+ | |||
+ | Messages are sent using MessageslotSend() if the Messageslot is full and no more messages can be queued then an error will be returned instead of waiting for more space to be available. | ||
+ | |||
+ | '''Mailslot''' - | ||
+ | |||
+ | The Mailslot is similar to the Messageslot above and allows multiple threads to wait for messages to be received. Unlike a Messageslot where the sender will not wait if there is no space available to send, in a mailslot both the sender and receiver will wait for either available space or received messages. Mailslot messages are also an arbitrary pointer which means practically anything can be sent as long as the content is recognized by both the sender and receiver. | ||
+ | |||
+ | Not suitable for use by Interrupt handlers. | ||
+ | |||
+ | Suitable for use on multiprocessor systems. | ||
+ | |||
+ | '''''Usage:''''' | ||
+ | |||
+ | ''Create/Destroy'' | ||
+ | |||
+ | Mailslots are created using MailslotCreate() and destroyed using MailslotDestroy(). | ||
+ | |||
+ | ''Send/Receive'' | ||
+ | |||
+ | Threads wait for messages by calling MailslotReceive() or MailslotReceiveEx() to wait with a timeout. | ||
+ | |||
+ | Messages are sent using MailslotSend() or MailslotSendEx(), if the Mailslot is full and no more messages can be queued the sender will wait until more space becomes available. | ||
+ | |||
+ | '''Buffer''' - | ||
+ | |||
+ | A circular list which can hold blocks of memory, allocated records or any other type of pointer that needs to be acquired, used and later released as part of a data transfer or queuing mechanism. Buffers simply contain pointers so their content is completely up to the user to determine, the number of entries and the size of each entry must be specified when creating a Buffer. | ||
+ | |||
+ | Not suitable for use by Interrupt handlers. | ||
+ | |||
+ | Suitable for use on multiprocessor systems. | ||
+ | |||
+ | '''''Usage:''''' | ||
+ | |||
+ | ''Create/Destroy'' | ||
+ | |||
+ | Buffers are created using BufferCreate() or BufferCreateEx() and destroyed using BufferDestroy(). | ||
+ | |||
+ | ''Get/Free'' | ||
+ | |||
+ | The next available buffer entry is obtained by calling BufferGet() or BufferGetEx() to specify a timeout. | ||
+ | |||
+ | When the buffer is no longer required it can be returned to the list by calling BufferFree() and will be made available again. | ||
+ | |||
+ | During initialization of the Buffer all entries can be enumerated (in order to set initial values etc) by calling BufferIterate() however once the Buffer is in operation (and any entries have been obtained) it is not valid to call iterate again. | ||
+ | |||
+ | '''Event''' - | ||
+ | |||
+ | Events are a serialization object modelled on the Windows object of the same name, they can be set to allow threads to pass through or reset to force threads to wait. Events can also be pulsed to allow a only single waiting thread to pass. | ||
+ | |||
+ | Not suitable for use by Interrupt handlers. | ||
+ | |||
+ | Suitable for use on multiprocessor systems. | ||
+ | |||
+ | '''''Usage:''''' | ||
+ | |||
+ | ''Create/Destroy'' | ||
+ | |||
+ | Events are created using EventCreate() or EventCreateEx() and destroyed using EventDestroy(). | ||
+ | |||
+ | ''Wait/Set/Reset/Pulse'' | ||
+ | |||
+ | Threads call EventWait() to either wait for the Event to be set or pass through immediately if already set. | ||
+ | |||
+ | Calling EventSet(), EventReset() or EventPulse() changes the state of the Event and either allows threads to pass or require them to wait depending on the values defined when the Event was created. | ||
+ | |||
+ | See the description in the header of each function below for detailed information about the behaviour in each state. | ||
+ | |||
+ | '''Timer''' - | ||
+ | |||
+ | Timers provide a mechanism to request that a thread from the timer pool perform a specified function call in a certain number of milliseconds from the time the request was made. This can be a convenient way to retry an operation after a predetermined amount of time or to delay an operation until a certain amount of time has passed. Timers can be created as once off or recurring and can pass a supplied pointer to the called function. | ||
+ | |||
+ | Not suitable for use by Interrupt handlers. | ||
+ | |||
+ | Suitable for use on multiprocessor systems. | ||
+ | |||
+ | '''''Usage:''''' | ||
+ | |||
+ | ''Create/Destroy'' | ||
+ | |||
+ | Timers are created using TimerCreate() or TimerCreateEx() and destroyed using TimerDestroy(). | ||
+ | |||
+ | ''Enable/Disable'' | ||
+ | |||
+ | Timers can be enabled or disabled using the TimerEnable() and TimerDisable() functions, calling TimerEnableEx() allows redefining some of the parameters specified during the call to TimerCreate() so an existing Timer can be reused for multiple purposes. | ||
+ | |||
+ | '''Worker''' - | ||
+ | |||
+ | The Worker thread pool provides a resource that can be used by system tasks and by applications as a convenient and reliable way to allocate work to other threads for asynchronous completion. The number of threads in the Worker pool can be dynamically increased or decreased to handle varying workloads. Using Worker threads to offload tasks can greatly simplify application design but does require attention be given to thread safety of data that is passed to Worker threads. | ||
+ | |||
+ | Not suitable for use by Interrupt handlers unless the WorkerScheduleIRQ or WorkerScheduleFIQ functions are used. | ||
+ | |||
+ | Suitable for use on multiprocessor systems. | ||
+ | |||
+ | '''''Usage:''''' | ||
+ | |||
+ | ''Schedule/Cancel'' | ||
+ | |||
+ | A task can be scheduled to a Worker thread by calling WorkerSchedule() or WorkerScheduleEx() depending on the parameters that need to be supplied. An already scheduled task can be cancelled by calling WorkerCancel() up until the point where the task is assigned to a Worker thread. | ||
+ | |||
+ | '''''IRQ and FIQ Usage:''''' | ||
+ | |||
+ | WorkerScheduleIRQ() and WorkerScheduleFIQ() are designed to allow calling from interrupt handlers (IRQ or FIQ) and provide deadlock prevention mechanisms. | ||
+ | |||
+ | WorkerScheduleIRQ() relies on the fact the scheduler will either be bound to an IRQ or an FIQ, in either case IRQ is disabled while the scheduler is active and in any calls with queue, list and thread locks that check for the scheduler assignment. | ||
+ | |||
+ | This means that an IRQ cannot occur when the scheduler is active or while it is blocked by a lock, calls to this function from a IRQ interrupt handler cannot deadlock. | ||
+ | |||
+ | WorkerScheduleFIQ() checks for the assignment of the scheduler, if the scheduler is bound to an FIQ then it proceeds as per the IRQ version because the FIQ cannot occur when the scheduler is active or while it is blocked by a lock. If the scheduler is bound to an IRQ then this function reverts to using the Tasker instead to transfer FIQ operations to an IRQ handler. | ||
+ | |||
+ | Both functions only support immediate scheduling of a one time task, delayed or repeating tasks cannot be scheduled. | ||
+ | |||
+ | It is safe to call either function from non interrupt code in order to allow shared code paths etc, however frequent calls to these functions from normal code can affect interrupt latency. | ||
+ | |||
+ | '''Tasker''' - | ||
+ | |||
+ | The Tasker is a mechanism for transferring work from a fast interrupt (FIQ) handler to an interrupt (IRQ) handler in order to allow access to certain operations which could otherwise deadlock. When the scheduler is bound to an IRQ then all queue, list and thread locks disable IRQ in order to prevent preemption by the scheduler, when IRQ is disabled then FIQ is still enabled and can preempt code that is holding an IRQ lock. If the FIQ handler attempts to access any of these locks then the handler can deadlock waiting for code that it had preempted. | ||
+ | |||
+ | In normal operation the clock interrupt is used to service the tasker list however it is board specific and could be assigned to either a different interrupt or a dedicated interrupt if required. | ||
+ | |||
+ | Suitable for use by Fast Interrupt handlers and Interrupt handlers (Not required for Interrupt handlers). | ||
+ | |||
+ | Suitable for use on multiprocessor systems. | ||
+ | |||
+ | '''''Usage:''''' | ||
+ | |||
+ | There are currently five Tasker functions available, TaskerThreadSendMessage(), TaskerMessageslotSend(), TaskerSemaphoreSignal(), TaskerCompletionReset() and TaskerCompletionComplete() which each perform the same function as their non Tasker equivalent. | ||
+ | |||
+ | The Tasker list is checked on each clock interrupt for tasks waiting to be triggered, the task is performed directly by the clock interrupt so the delay between request and trigger is no more than one clock interrupt interval. | ||
+ | |||
+ | '''Services''' | ||
+ | |||
+ | In addition to the various synchronization and serialization objects described above the following services are provided by this unit: | ||
+ | |||
+ | ThreadManager | ||
+ | Thread Creation and Stack allocation | ||
+ | Thread Termination, Stack deallocation and cleanup | ||
+ | Thread Functions (Sleep/Kill/Suspend/Resume etc) | ||
+ | IRQ Thread (Boot process becomes the IRQ or FIQ Thread) | ||
+ | FIQ Thread | ||
+ | Idle Thread (An always ready thread which measures utilization) | ||
+ | Main Thread (Main thread executes PASCALMAIN) | ||
+ | Timer Threads (Pool of threads to service Timer requests) | ||
+ | Worker Threads (Pool of threads to service Worker requests) | ||
+ | Thread Scheduling, Allocation, Priority, Affinity and Migration | ||
+ | |||
+ | '''Stolen wakeups''' | ||
+ | |||
+ | Locking and synchronization types such as CriticalSection, Semaphore, Condition, Event, Messageslot and Mailslot use a wait queue internally to determine which thread has been waiting the longest. When a thread is removed from the wait queue so it can obtain the lock, semaphore, event etc there is a small window where the lock, semaphore or event may be acquired by another thread before the thread that was just woken from the wait queue. This is called a stolen wakeup and can happen in many systems including Windows and Linux, in some systems the caller is expected to check the state of a predicate value on return in order to detect a stolen wakeup. In Ultibo the code within the lock, semaphore, event etc functions automatically checks for a stolen wakeup and takes appropriate action to either return the thread to the wait queue or return with a timeout (where appropriate) so that the caller can respond accordingly. | ||
+ | |||
+ | In no case will a call to a locking or synchronization function fail due to a stolen wakeup, the worst case scenario is that a thread may wait longer than it should have (ie it is returned to the back of the queue) or it may return with a timeout before the specified timeout value has expired. | ||
=== Constants === | === Constants === | ||
---- | ---- | ||
− | '' | + | |
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Lock flag''' <code> LOCK_FLAG_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>LOCK_FLAG_NONE = $00000000;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>LOCK_FLAG_IRQ = $00000001;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>LOCK_FLAG_FIQ = $00000002;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>LOCK_FLAG_IRQFIQ = $00000004;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Spin signature''' <code> SPIN_SIGNATURE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SPIN_SIGNATURE = $0FEC3B82;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Spin state''' <code> SPIN_STATE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SPIN_STATE_UNLOCKED = 0;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>SPIN_STATE_LOCKED = 1;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Mutex signature''' <code> MUTEX_SIGNATURE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>MUTEX_SIGNATURE = $1C5D7FA4;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Mutex state''' <code> MUTEX_STATE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>MUTEX_STATE_UNLOCKED = 0;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>MUTEX_STATE_LOCKED = 1;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Mutex flags''' <code> MUTEX_FLAG_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>MUTEX_FLAG_NONE = $00000000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>MUTEX_FLAG_RECURSIVE = $00000001;</code> | ||
+ | | Mutex can be locked multiple times by the same thread if set (Must be unlocked the same number of times) | ||
+ | |- | ||
+ | | <code>MUTEX_FLAG_ERRORCHECK = $00000002;</code> | ||
+ | | Mutex will perform a deadlock check if set, will return with an error if already owned by the same thread (and not recursive) | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Critical section signature''' <code> CRITICAL_SECTION_SIGNATURE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>CRITICAL_SECTION_SIGNATURE = $25F3AE01;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Critical section state''' <code> CRITICAL_SECTION_STATE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>CRITICAL_SECTION_STATE_UNLOCKED = 0;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>CRITICAL_SECTION_STATE_LOCKED = 1;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Semaphore signature''' <code> SEMAPHORE_SIGNATURE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SEMAPHORE_SIGNATURE = $390A1EB4;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Semaphore flag''' <code> SEMAPHORE_FLAG_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SEMAPHORE_FLAG_NONE = LOCK_FLAG_NONE;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>SEMAPHORE_FLAG_IRQ = LOCK_FLAG_IRQ;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SEMAPHORE_FLAG_FIQ = LOCK_FLAG_FIQ;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SEMAPHORE_FLAG_IRQFIQ = LOCK_FLAG_IRQFIQ;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Synchronizer signature''' <code> SYNCHRONIZER_SIGNATURE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SYNCHRONIZER_SIGNATURE = $C5D081FB;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Synchronizer state''' <code> SYNCHRONIZER_STATE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SYNCHRONIZER_STATE_UNLOCKED = 0;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>SYNCHRONIZER_STATE_READER_LOCKED = 1;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SYNCHRONIZER_STATE_WRITER_LOCKED = 2;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Synchronizer flag''' <code> SYNCHRONIZER_FLAG_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SYNCHRONIZER_FLAG_NONE = $00000000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SYNCHRONIZER_FLAG_READ_PRIORITY = $00000001;</code> | ||
+ | | Synchronizer prioritises readers over writers | ||
+ | |- | ||
+ | | <code>SYNCHRONIZER_FLAG_WRITE_PRIORITY = $00000002;</code> | ||
+ | | Synchronizer prioritises writers over readers | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Condition constants''' <code> CONDITION_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>CONDITION_SIGNATURE = $D14D3C0A;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Condition flags''' <code> CONDITION_FLAG_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>CONDITION_FLAG_NONE = $00000000;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Condition lock flags''' <code> CONDITION_LOCK_FLAG_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>CONDITION_LOCK_FLAG_NONE = $00000000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>CONDITION_LOCK_FLAG_WRITER = $00000001;</code> | ||
+ | | Condition should release and acquire the writer lock on a Synchronizer when ConditionWaitSynchronizer is called (otherwise release and acquire the reader lock) | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Completion constants''' <code> COMPLETION_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>COMPLETION_SIGNATURE = $FCE24CA1;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Completion state''' <code> COMPLETION_STATE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>COMPLETION_STATE_RESET = 0;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>COMPLETION_STATE_COMPLETE = 1;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Completion flag''' <code> COMPLETION_FLAG_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>COMPLETION_FLAG_NONE = LOCK_FLAG_NONE;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>COMPLETION_FLAG_IRQ = LOCK_FLAG_IRQ;</code> | ||
+ | | Disable IRQ during completion operations (Wait/Reset/Complete) | ||
+ | |- | ||
+ | | <code>COMPLETION_FLAG_FIQ = LOCK_FLAG_FIQ;</code> | ||
+ | | Disable FIQ during completion operations (Wait/Reset/Complete) | ||
+ | |- | ||
+ | | <code>COMPLETION_FLAG_IRQFIQ = LOCK_FLAG_IRQFIQ;</code> | ||
+ | | Disable IRQ and FIQ during completion operations (Wait/Reset/Complete) | ||
+ | |- | ||
+ | | <code>COMPLETION_FLAG_COUNTED = $00000008;</code> | ||
+ | | Use a counted value instead of a single state (Affects behaviour of Wait and Complete) | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''List signature''' <code> LIST_SIGNATURE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>LIST_SIGNATURE = $4A98BE2A;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''List type''' <code> LIST_TYPE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>LIST_TYPE_NOT_SPECIFIED = 0;</code> | ||
+ | | A generic thread list without a specific purpose | ||
+ | |- | ||
+ | | <code>LIST_TYPE_WAIT_SECTION = 1;</code> | ||
+ | | A Critical Section Wait List | ||
+ | |- | ||
+ | | <code>LIST_TYPE_WAIT_SEMAPHORE = 2;</code> | ||
+ | | A Semaphore Wait List | ||
+ | |- | ||
+ | | <code>LIST_TYPE_WAIT_SYNCHRONIZER = 3;</code> | ||
+ | | A Synchronizer Wait List | ||
+ | |- | ||
+ | | <code>LIST_TYPE_WAIT_CONDITION = 4;</code> | ||
+ | | A Condition Wait List | ||
+ | |- | ||
+ | | <code>LIST_TYPE_WAIT_COMPLETION = 5;</code> | ||
+ | | A Condition Wait List | ||
+ | |- | ||
+ | | <code>LIST_TYPE_WAIT_EVENT = 6;</code> | ||
+ | | An Event Wait List | ||
+ | |- | ||
+ | | <code>LIST_TYPE_WAIT_THREAD = 7;</code> | ||
+ | | A Thread Wait List | ||
+ | |- | ||
+ | | <code>LIST_TYPE_WAIT_MESSAGESLOT = 8;</code> | ||
+ | | A Messageslot Wait List | ||
+ | |- | ||
+ | | <code>LIST_TYPE_WAIT_OTHER = 9;</code> | ||
+ | | Another type of Wait List (Suitable for passing to ThreadWait/ThreadWaitEx/ThreadWaitMultiple/ThreadRelease) | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''List flag''' <code> LIST_FLAG_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>LIST_FLAG_NONE = LOCK_FLAG_NONE;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>LIST_FLAG_IRQ = LOCK_FLAG_IRQ;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>LIST_FLAG_FIQ = LOCK_FLAG_FIQ;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>LIST_FLAG_IRQFIQ = LOCK_FLAG_IRQFIQ;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Queue signature''' <code> QUEUE_SIGNATURE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>QUEUE_SIGNATURE = $57A3BF9E;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Queue type''' <code> QUEUE_TYPE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>QUEUE_TYPE_NOT_SPECIFIED = 0;</code> | ||
+ | | A generic thread queue without a specific purpose | ||
+ | |- | ||
+ | | <code>QUEUE_TYPE_SCHEDULE_SLEEP = 1;</code> | ||
+ | | A Scheduler Sleep Queue | ||
+ | |- | ||
+ | | <code>QUEUE_TYPE_SCHEDULE_TIMEOUT = 2;</code> | ||
+ | | A Scheduler Timeout Queue | ||
+ | |- | ||
+ | | <code>QUEUE_TYPE_SCHEDULE_TERMINATION = 3;</code> | ||
+ | | A Scheduler Termination Queue (Threads are placed on termination queue when they exit or are terminated) | ||
+ | |- | ||
+ | | <code>QUEUE_TYPE_SCHEDULE_NONE = 4;</code> | ||
+ | | A Scheduler No Priority Queue (Only used for IRQ/FIQ threads which are never selected for scheduling) | ||
+ | |- | ||
+ | | <code>QUEUE_TYPE_SCHEDULE_IDLE = 5;</code> | ||
+ | | A Scheduler Idle Priority Queue | ||
+ | |- | ||
+ | | <code>QUEUE_TYPE_SCHEDULE_LOWEST = 6;</code> | ||
+ | | A Scheduler Lowest Priority Queue | ||
+ | |- | ||
+ | | <code>QUEUE_TYPE_SCHEDULE_LOWER = 7;</code> | ||
+ | | A Scheduler Lower Priority Queue | ||
+ | |- | ||
+ | | <code>QUEUE_TYPE_SCHEDULE_NORMAL = 8;</code> | ||
+ | | A Scheduler Normal Priority Queue | ||
+ | |- | ||
+ | | <code>QUEUE_TYPE_SCHEDULE_HIGHER = 9;</code> | ||
+ | | A Scheduler Higher Priority Queue | ||
+ | |- | ||
+ | | <code>QUEUE_TYPE_SCHEDULE_HIGHEST = 10;</code> | ||
+ | | A Scheduler Highest Priority Queue | ||
+ | |- | ||
+ | | <code>QUEUE_TYPE_SCHEDULE_CRITICAL = 11;</code> | ||
+ | | A Scheduler Critical Priority Queue | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Queue flag''' <code> QUEUE_FLAG_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>NONE = LOCK_FLAG_NONE;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>QUEUE_FLAG_IRQ = LOCK_FLAG_IRQ;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>QUEUE_FLAG_FIQ = LOCK_FLAG_FIQ;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>QUEUE_FLAG_IRQFIQ = LOCK_FLAG_IRQFIQ;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>QUEUE_FLAG_DESCENDING = $00000008;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>QUEUE_FLAG_DELTA = $00000010;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Queue key''' <code> QUEUE_KEY_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>QUEUE_KEY_NONE = Integer($7FFFFFFF);</code> | ||
+ | | Null key value returned from an empty Queue | ||
+ | |- | ||
+ | | <code>QUEUE_KEY_MAX = Integer($7FFFFFFE);</code> | ||
+ | | Max key that can be ordered in a Queue | ||
+ | |- | ||
+ | | <code>QUEUE_KEY_MIN = Integer($80000000);</code> | ||
+ | | Min key that can be ordered in a Queue | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Thread signature''' <code> THREAD_SIGNATURE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>THREAD_SIGNATURE = $6C2BA10F;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Thread type''' <code> THREAD_TYPE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>THREAD_TYPE_NORMAL = 0;</code> | ||
+ | | A Normal thread (No special case handling) | ||
+ | |- | ||
+ | | <code>THREAD_TYPE_IDLE = 1;</code> | ||
+ | | An Idle thread (Used to calculate ultilization and provide an always ready thread) | ||
+ | |- | ||
+ | | <code>THREAD_TYPE_IRQ = 2;</code> | ||
+ | | An IRQ thread (Used by the IRQ handler during interrupt time) | ||
+ | |- | ||
+ | | <code>THREAD_TYPE_FIQ = 3;</code> | ||
+ | | An FIQ thread (Used by the FIQ handler during interrupt time) | ||
+ | |- | ||
+ | | <code>THREAD_TYPE_SWI = 4;</code> | ||
+ | | A Software Interrupt (SWI) thread (Used by the SWI handler during a system call) | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Thread flag''' <code> THREAD_FLAG_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>THREAD_FLAG_NONE = $00000000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>THREAD_FLAG_PERSIST = $00000001;</code> | ||
+ | | If set thread handle will persist until explicitly destroyed (Otherwise destroyed after termination quantum has elapsed) | ||
+ | |- | ||
+ | | <code>THREAD_FLAG_CANCELLED = $00000002;</code> | ||
+ | | Indicates that thread has been cancelled, for support of external thread APIs eg. pThreads (Not used internally by Ultibo) | ||
+ | |- | ||
+ | | <code>THREAD_FLAG_CANCEL_DISABLE = $00000004;</code> | ||
+ | | Indicates that thread cancellation is disabled for a thread, for support of external thread APIs eg. pThreads (Not used internally by Ultibo) | ||
+ | |- | ||
+ | | <code>THREAD_FLAG_CANCEL_ASYNCHRONOUS = $00000008;</code> | ||
+ | | Indicates that asynchronous thread cancellation is enabled for a thread, for support of external thread APIs eg. pThreads (Not used internally by Ultibo) | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>THREAD_FLAG_INTERNAL = THREAD_FLAG_NONE + $80000000;</code> | ||
+ | | Note: Temporary value to avoid warning | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Thread state''' <code> THREAD_STATE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>THREAD_STATE_RUNNING = 1;</code> | ||
+ | | Thread is currently running | ||
+ | |- | ||
+ | | <code>THREAD_STATE_READY = 2;</code> | ||
+ | | Thread is on ready queue | ||
+ | |- | ||
+ | | <code>THREAD_STATE_SLEEP = 3;</code> | ||
+ | | Thread is sleeping | ||
+ | |- | ||
+ | | <code>THREAD_STATE_SUSPENDED = 4;</code> | ||
+ | | Thread is suspended | ||
+ | |- | ||
+ | | <code>THREAD_STATE_WAIT = 5;</code> | ||
+ | | Thread is on a wait list | ||
+ | |- | ||
+ | | <code>THREAD_STATE_WAIT_TIMEOUT = 6;</code> | ||
+ | | Thread is on a wait list with timeout | ||
+ | |- | ||
+ | | <code>THREAD_STATE_RECEIVE = 7;</code> | ||
+ | | Thread is waiting to receive a message | ||
+ | |- | ||
+ | | <code>THREAD_STATE_RECEIVE_TIMEOUT = 8;</code> | ||
+ | | Thread is waiting to receive a message with timeout | ||
+ | |- | ||
+ | | <code>THREAD_STATE_HALTED = 9;</code> | ||
+ | | Thread has been halted (Due to an unhandled exception etc) | ||
+ | |- | ||
+ | | <code>THREAD_STATE_TERMINATED = 10;</code> | ||
+ | | Thread has been terminated | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Thread priority''' <code> THREAD_PRIORITY_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>THREAD_PRIORITY_NONE = 0;</code> | ||
+ | | Only used for IRQ/FIQ threads which are never selected for scheduling | ||
+ | |- | ||
+ | | <code>THREAD_PRIORITY_IDLE = 1;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>THREAD_PRIORITY_LOWEST = 2;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>THREAD_PRIORITY_LOWER = 3;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>THREAD_PRIORITY_NORMAL = 4;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>THREAD_PRIORITY_HIGHER = 5;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>THREAD_PRIORITY_HIGHEST = 6;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>THREAD_PRIORITY_CRITICAL = 7;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>THREAD_PRIORITY_DEFAULT = THREAD_PRIORITY_NORMAL;</code> | ||
+ | | Default thread priority | ||
+ | |- | ||
+ | | <code>THREAD_PRIORITY_MINIMUM = THREAD_PRIORITY_IDLE;</code> | ||
+ | | Minimum thread priority | ||
+ | |- | ||
+ | | <code>THREAD_PRIORITY_MAXIMUM = THREAD_PRIORITY_CRITICAL;</code> | ||
+ | | Maximum thread priority | ||
+ | |- | ||
+ | | <code>THREAD_PRIORITY_COUNT = THREAD_PRIORITY_MAXIMUM + 1;</code> | ||
+ | | Number of thread priority levels | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | |colspan="2"|''Additional priority aliases for compatibility'' | ||
+ | |- | ||
+ | | <code>THREAD_PRIORITY_BELOW_NORMAL = THREAD_PRIORITY_LOWER;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>THREAD_PRIORITY_ABOVE_NORMAL = THREAD_PRIORITY_HIGHER;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>THREAD_PRIORITY_TIME_CRITICAL = THREAD_PRIORITY_CRITICAL;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Thread name''' <code> THREAD_NAME_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>THREAD_NAME_LENGTH = SIZE_64;</code> | ||
+ | | Length of thread name | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>IRQ_THREAD_NAME = 'IRQ';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FIQ_THREAD_NAME = 'FIQ';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SWI_THREAD_NAME = 'SWI';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>IDLE_THREAD_NAME = 'Idle';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>MAIN_THREAD_NAME = 'Main';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>TIMER_THREAD_NAME = 'Timer';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>WORKER_THREAD_NAME = 'Worker';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>TIMER_PRIORITY_THREAD_NAME = 'Priority Timer';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>WORKER_PRIORITY_THREAD_NAME = 'Priority Worker';</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>RTL_THREAD_NAME = 'RTL Thread';</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Thread priority''' <code> *_THREAD_PRIORITY </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>TIMER_THREAD_PRIORITY = THREAD_PRIORITY_NORMAL;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>WORKER_THREAD_PRIORITY = THREAD_PRIORITY_NORMAL;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>TIMER_PRIORITY_THREAD_PRIORITY = THREAD_PRIORITY_HIGHEST;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>WORKER_PRIORITY_THREAD_PRIORITY = THREAD_PRIORITY_HIGHER;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Thread create''' <code> THREAD_CREATE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>THREAD_CREATE_NONE = $00000000;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>THREAD_CREATE_SUSPENDED = $00000004;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Thread TLS''' <code> THREAD_TLS_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>THREAD_TLS_FREE = $00000000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>THREAD_TLS_USED = $00000001;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>THREAD_TLS_INVALID = $FFFFFFFF;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>THREAD_TLS_MAXIMUM = SIZE_64;</code> | ||
+ | | The maximum number TLS index slots available | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Thread TLS flag''' <code> THREAD_TLS_FLAG_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>THREAD_TLS_FLAG_NONE = $00000000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>THREAD_TLS_FLAG_FREE = $00000001;</code> | ||
+ | | If set then pointer in thread TLS index will be freed on ThreadReleaseTlsIndex or ThreadDestroy | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Thread wait''' <code> THREAD_LISTS_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>THREAD_LISTS_MAXIMUM = SIZE_64;</code> | ||
+ | | Maximum number of lists a thread can wait on at the same time | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Messageslot signature''' <code> MESSAGESLOT_SIGNATURE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>MESSAGESLOT_SIGNATURE = $B631CE4B;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Messageslot flag''' <code> MESSAGESLOT_FLAG_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>MESSAGESLOT_FLAG_NONE = LOCK_FLAG_NONE;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>MESSAGESLOT_FLAG_IRQ = LOCK_FLAG_IRQ;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>MESSAGESLOT_FLAG_FIQ = LOCK_FLAG_FIQ;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>MESSAGESLOT_FLAG_IRQFIQ = LOCK_FLAG_IRQFIQ;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Mailslot signature''' <code> MAILSLOT_SIGNATURE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>MAILSLOT_SIGNATURE = $7A409BF3;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Buffer signature''' <code> BUFFER_SIGNATURE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>BUFFER_SIGNATURE = $830BEA71;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Buffer flag''' <code> BUFFER_FLAG_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>BUFFER_FLAG_NONE = $00000000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>BUFFER_FLAG_SHARED = $00000001;</code> | ||
+ | | If set the buffer memory (Not the buffer entry itself) is allocated from shared memory | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Event signature''' <code> EVENT_SIGNATURE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>EVENT_SIGNATURE = $903BA69D;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Event state''' <code> EVENT_STATE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>EVENT_STATE_UNSIGNALED = 0;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>EVENT_STATE_SIGNALED = 1;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Event flag''' <code> EVENT_FLAG_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>EVENT_FLAG_NONE = $00000000;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>EVENT_FLAG_INITIAL_STATE = $00000001;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>EVENT_FLAG_MANUAL_RESET = $00000002;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Timer signature''' <code> TIMER_SIGNATURE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>TIMER_SIGNATURE = $AB7E07FB;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Timer state''' <code> TIMER_STATE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>TIMER_STATE_DISABLED = 0;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>TIMER_STATE_ENABLED = 1;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Timer flag''' <code> TIMER_FLAG_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>TIMER_FLAG_NONE = $00000000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>TIMER_FLAG_RESCHEDULE = $00000001;</code> | ||
+ | | Timer should be rescheduled each time the event completes | ||
+ | |- | ||
+ | | <code>TIMER_FLAG_IMMEDIATE = $00000002;</code> | ||
+ | | Timer event should be executed immediately and then each interval milliseconds | ||
+ | |- | ||
+ | | <code>TIMER_FLAG_WORKER = $00000004;</code> | ||
+ | | Timer event should be executed by a worker thread instead of a timer thread | ||
+ | |- | ||
+ | | <code>TIMER_FLAG_PRIORITY = $00000008;</code> | ||
+ | | Timer event should be executed by a priority timer thread | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Timer key''' <code> TIMER_KEY_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>TIMER_KEY_NONE = Integer($7FFFFFFF);</code> | ||
+ | | Null key value returned from an empty Timer list | ||
+ | |- | ||
+ | | <code>TIMER_KEY_MAX = Integer($7FFFFFFE);</code> | ||
+ | | Max key that can be ordered in a Timer list | ||
+ | |- | ||
+ | | <code>TIMER_KEY_MIN = Integer($80000000);</code> | ||
+ | | Min key that can be ordered in a Timer list | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Worker signature''' <code> WORKER_SIGNATURE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>WORKER_SIGNATURE = $EF6A901B;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Worker flag''' <code> WORKER_FLAG_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>WORKER_FLAG_NONE = $00000000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>WORKER_FLAG_RESCHEDULE = $00000001;</code> | ||
+ | | Worker task should be rescheduled each time the task completes | ||
+ | |- | ||
+ | | <code>WORKER_FLAG_IMMEDIATE = $00000002;</code> | ||
+ | | Worker task should be executed immediately and then each interval milliseconds | ||
+ | |- | ||
+ | | <code>WORKER_FLAG_CANCEL = $00000004;</code> | ||
+ | | Internal flag to indicate the worker task should be cancelled next time the interval expires | ||
+ | |- | ||
+ | | <code>WORKER_FLAG_NOFREE = $00000008;</code> | ||
+ | | Internal flag to tell worker execute not to free the worker request when it is completed | ||
+ | |- | ||
+ | | <code>WORKER_FLAG_TERMINATE = $00000010;</code> | ||
+ | | Internal flag to tell worker execute to terminate the worker thread | ||
+ | |- | ||
+ | | <code>WORKER_FLAG_IRQ = $00000020;</code> | ||
+ | | Internal flag to tell worker execute to free IRQ memory when the request is completed | ||
+ | |- | ||
+ | | <code>WORKER_FLAG_FIQ = $00000040;</code> | ||
+ | | Internal flag to tell worker execute to free FIQ memory when the request is completed | ||
+ | |- | ||
+ | | <code>WORKER_FLAG_PRIORITY = $00000080;</code> | ||
+ | | Worker task should be executed by a priority worker thread | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>WORKER_FLAG_INTERNAL = WORKER_FLAG_CANCEL or WORKER_FLAG_NOFREE or WORKER_FLAG_TERMINATE or WORKER_FLAG_IRQ or WORKER_FLAG_FIQ;</code> | ||
+ | | Internal only flags | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>WORKER_FLAG_EXCLUDED_IRQ = WORKER_FLAG_RESCHEDULE or WORKER_FLAG_IMMEDIATE;</code> | ||
+ | | Excluded flags | ||
+ | |- | ||
+ | | <code>WORKER_FLAG_EXCLUDED_FIQ = WORKER_FLAG_RESCHEDULE or WORKER_FLAG_IMMEDIATE;</code> | ||
+ | | Excluded flags | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Tasker task''' <code> TASKER_TASK_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>TASKER_TASK_THREADSENDMESSAGE = 1;</code> | ||
+ | | Perform a ThreadSendMessage() function using the tasker list | ||
+ | |- | ||
+ | | <code>TASKER_TASK_MESSAGESLOTSEND = 2;</code> | ||
+ | | Perform a MessageslotSend() function using the tasker list | ||
+ | |- | ||
+ | | <code>TASKER_TASK_SEMAPHORESIGNAL = 3;</code> | ||
+ | | Perform a SemaphoreSignal() function using the tasker list | ||
+ | |- | ||
+ | | <code>TASKER_TASK_COMPLETIONRESET = 4;</code> | ||
+ | | Perform a CompletionReset() function using the tasker list | ||
+ | |- | ||
+ | | <code>TASKER_TASK_COMPLETIONCOMPLETE = 5;</code> | ||
+ | | Perform a CompletionComplete() or CompletionCompleteAll() function using the tasker list | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Scheduler migration''' <code> SCHEDULER_MIGRATION_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SCHEDULER_MIGRATION_DISABLED = 0;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>SCHEDULER_MIGRATION_ENABLED = 1;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Scheduler preempt''' <code> SCHEDULER_PREEMPT_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SCHEDULER_PREEMPT_DISABLED = 0;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>SCHEDULER_PREEMPT_ENABLED = 1;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Scheduler allocation''' <code> SCHEDULER_ALLOCATION_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SCHEDULER_ALLOCATION_DISABLED = 0;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>SCHEDULER_ALLOCATION_ENABLED = 1;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Scheduler mask''' <code> SCHEDULER_MASK_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SCHEDULER_MASK_NONE = (1 shl THREAD_PRIORITY_NONE);</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>SCHEDULER_MASK_IDLE = (1 shl THREAD_PRIORITY_IDLE);</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCHEDULER_MASK_LOWEST = (1 shl THREAD_PRIORITY_LOWEST);</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCHEDULER_MASK_LOWER = (1 shl THREAD_PRIORITY_LOWER);</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCHEDULER_MASK_NORMAL = (1 shl THREAD_PRIORITY_NORMAL);</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCHEDULER_MASK_HIGHER = (1 shl THREAD_PRIORITY_HIGHER); </code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCHEDULER_MASK_HIGHEST = (1 shl THREAD_PRIORITY_HIGHEST);</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCHEDULER_MASK_CRITICAL = (1 shl THREAD_PRIORITY_CRITICAL);</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Scheduler quantum''' <code> SCHEDULER_QUANTUM_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SCHEDULER_QUANTUM_NONE = 0;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>SCHEDULER_QUANTUM_IDLE = 0;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCHEDULER_QUANTUM_LOWEST = 1;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCHEDULER_QUANTUM_LOWER = 2;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCHEDULER_QUANTUM_NORMAL = 4;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCHEDULER_QUANTUM_HIGHER = 6;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCHEDULER_QUANTUM_HIGHEST = 8;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SCHEDULER_QUANTUM_CRITICAL = 10;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Thread logging''' <code> THREAD_LOG_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>THREAD_LOG_LEVEL_DEBUG = LOG_LEVEL_DEBUG;</code> | ||
+ | | Thread debugging messages | ||
+ | |- | ||
+ | | <code>THREAD_LOG_LEVEL_INFO = LOG_LEVEL_INFO;</code> | ||
+ | | Thread informational messages, such as a thread being created or destroyed | ||
+ | |- | ||
+ | | <code>THREAD_LOG_LEVEL_WARN = LOG_LEVEL_WARN;</code> | ||
+ | | Thread warning messages | ||
+ | |- | ||
+ | | <code>THREAD_LOG_LEVEL_ERROR = LOG_LEVEL_ERROR;</code> | ||
+ | | Thread error messages | ||
+ | |- | ||
+ | | <code>THREAD_LOG_LEVEL_NONE = LOG_LEVEL_NONE;</code> | ||
+ | | No Thread messages | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
=== Type definitions === | === Type definitions === | ||
---- | ---- | ||
− | '' | + | |
+ | '''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> | ||
+ | |||
+ | '''Condition entry''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PConditionEntry = ^TConditionEntry;</code> | ||
+ | |||
+ | <code>TConditionEntry = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|''Condition Properties'' | ||
+ | |- | ||
+ | | <code>Signature:LongWord;</code> | ||
+ | | Signature for entry validation | ||
+ | |- | ||
+ | | <code>Flags:LongWord;</code> | ||
+ | | Condition Flags (eg CONDITION_FLAG_NONE) | ||
+ | |- | ||
+ | | <code>Lock:TSpinHandle;</code> | ||
+ | | Condition Lock | ||
+ | |- | ||
+ | | <code>List:TListHandle;</code> | ||
+ | | List of threads waiting on this Condition (or INVALID_HANDLE_VALUE if never used) | ||
+ | |- | ||
+ | | <code>Wait:TThreadWait;</code> | ||
+ | | Wait function to call to wait on the Condition | ||
+ | |- | ||
+ | | <code>WaitEx:TThreadWaitEx;</code> | ||
+ | | Wait function to call to wait with timeout on the Condition | ||
+ | |- | ||
+ | | <code>Release:TThreadRelease;</code> | ||
+ | | Release function to call if any threads are waiting when Condition is woken | ||
+ | |- | ||
+ | | <code>Abandon:TThreadAbandon;</code> | ||
+ | | Abandon function to call if any threads are waiting when Condition is destroyed | ||
+ | |- | ||
+ | |colspan="2"|''Internal Properties'' | ||
+ | |- | ||
+ | | <code>Prev:PConditionEntry;</code> | ||
+ | | Previous entry in Condition table | ||
+ | |- | ||
+ | | <code>Next:PConditionEntry;</code> | ||
+ | | Next entry in Condition table | ||
+ | |- | ||
+ | |colspan="2"|''Statistics Properties'' | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Completion entry''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PCompletionEntry = ^TCompletionEntry;</code> | ||
+ | |||
+ | <code>TCompletionEntry = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|''Completion Properties'' | ||
+ | |- | ||
+ | | <code>Signature:LongWord;</code> | ||
+ | | Signature for entry validation | ||
+ | |- | ||
+ | | <code>State:LongWord;</code> | ||
+ | | State of the completion (Reset/Complete) | ||
+ | |- | ||
+ | | <code>Count:LongWord;</code> | ||
+ | | Count of the completion (Only applicable if COMPLETION_FLAG_COUNTED) | ||
+ | |- | ||
+ | | <code>Flags:LongWord;</code> | ||
+ | | Completion Flags (eg COMPLETION_FLAG_IRQ) | ||
+ | |- | ||
+ | | <code>Lock:TSpinHandle;</code> | ||
+ | | Completion Lock | ||
+ | |- | ||
+ | | <code>List:TListHandle;</code> | ||
+ | | List of threads waiting on this Completion (or INVALID_HANDLE_VALUE if never used) | ||
+ | |- | ||
+ | | <code>Wait:TThreadWait;</code> | ||
+ | | Wait function to call to wait on the Completion | ||
+ | |- | ||
+ | | <code>WaitEx:TThreadWaitEx;</code> | ||
+ | | Wait function to call to wait with timeout on the Completion | ||
+ | |- | ||
+ | | <code>Release:TThreadRelease;</code> | ||
+ | | Release function to call if any threads are waiting when Completion is completed | ||
+ | |- | ||
+ | | <code>Abandon:TThreadAbandon;</code> | ||
+ | | Abandon function to call if any threads are waiting when Completion is destroyed | ||
+ | |- | ||
+ | |colspan="2"|''Internal Properties'' | ||
+ | |- | ||
+ | | <code>Prev:PCompletionEntry;</code> | ||
+ | | Previous entry in Completion table | ||
+ | |- | ||
+ | | <code>Next:PCompletionEntry;</code> | ||
+ | | Next entry in Completion 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:PtrUInt;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>wParam:PtrUInt;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>lParam:PtrUInt;</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>Flags:LongWord;</code> | ||
+ | | Flags of the Thread (eg THREAD_FLAG_PERSIST) | ||
+ | |- | ||
+ | | <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>Flags:LongWord;</code> | ||
+ | | Flags of the Thread (eg THREAD_FLAG_PERSIST) | ||
+ | |- | ||
+ | | <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:PPtrInt;</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 messageslot 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 messageslot 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> | ||
+ | |||
+ | '''Tasker completion reset''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PTaskerCompletionReset = ^TTaskerCompletionReset;</code> | ||
+ | |||
+ | <code>TTaskerCompletionReset = 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>Completion:TCompletionHandle;</code> | ||
+ | | Handle of the completion to reset | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Tasker completion complete''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PTaskerCompletionComplete = ^TTaskerCompletionComplete;</code> | ||
+ | |||
+ | <code>TTaskerCompletionComplete = 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>Completion:TCompletionHandle;</code> | ||
+ | | Handle of the completion to complete or complete all | ||
+ | |- | ||
+ | | <code>All:LongBool;</code> | ||
+ | | False for complete, True for complete all | ||
+ | |- | ||
+ | |} | ||
+ | </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%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''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%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Condition wait''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TConditionWait = function(Condition:PConditionEntry; Timeout:LongWord):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Condition wait mutex''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TConditionWaitMutex = function(Condition:PConditionEntry; Mutex:TMutexHandle; Timeout:LongWord):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Condition wait synchronizer''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TConditionWaitSynchronizer = function(Condition:PConditionEntry; Synchronizer:TSynchronizerHandle; Flags,Timeout:LongWord):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Condition wait critical section''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TConditionWaitCriticalSection = function(Condition:PConditionEntry; CriticalSection:TCriticalSectionHandle; Timeout:LongWord):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Condition wake''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TConditionWake = function(Condition:PConditionEntry):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Condition wake all''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TConditionWakeAll = function(Condition:PConditionEntry):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Completion wait''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TCompletionWait = function(Completion:PCompletionEntry; Timeout:LongWord):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Completion try wait''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TCompletionTryWait = function(Completion:PCompletionEntry):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Completion reset''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TCompletionReset = function(Completion:PCompletionEntry):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Completion complete''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TCompletionComplete = function(Completion:PCompletionEntry):LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Completion complete all''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TCompletionCompleteAll = function(Completion:PCompletionEntry):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:PtrInt):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:PtrInt; 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):PtrInt;</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):PtrInt;</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 === | ||
---- | ---- | ||
− | '' | + | |
+ | '''Thread logging''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>THREAD_DEFAULT_LOG_LEVEL:LongWord = THREAD_LOG_LEVEL_DEBUG;</code> | ||
+ | | style="width: 40%;"|Minimum level for Thread messages. Only messages with level greater than or equal to this will be printed. | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>THREAD_LOG_ENABLED:Boolean;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Scheduler variables''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerThreadNext:LongWord;</code> | ||
+ | | style="width: 40%;"|The CPU to assign the next created thread to, round robin incremented on each create (Protected by ThreadTableLock) | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerThreadMigration:LongWord;</code> | ||
+ | | style="width: 40%;"|Enable or Disable thread migration (SCHEDULER_MIGRATION_DISABLED or SCHEDULER_MIGRATION_ENABLED | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerMigrationQuantum:LongWord;</code> | ||
+ | | style="width: 40%;"|Quantum for thread migration checks (CPU 0 only) | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerThreadCount:array of LongWord;</code> | ||
+ | | style="width: 40%;"|Current number of ready threads per CPU (One per CPU, allocated by scheduler initialization) (Protected by InterlockedIncrement/Decrement) | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerThreadQuantum:array of LongWord;</code> | ||
+ | | style="width: 40%;"|Quantum of current thread per CPU (One per CPU, allocated by scheduler initialization) | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerThreadPreempt:array of LongWord;</code> | ||
+ | | style="width: 40%;"|Current state of thread preemption per CPU (eg SCHEDULER_PREEMPT_DISABLED) (One per CPU, allocated by scheduler initialization) | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerThreadAllocation:array of LongWord;</code> | ||
+ | | style="width: 40%;"|Current state of thread allocation per CPU (eg SCHEDULER_ALLOCATION_DISABLED) (One per CPU, allocated by scheduler initialization) | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerPriorityMask:array of LongWord;</code> | ||
+ | | style="width: 40%;"|Mask of ready threads at each priority level (One per CPU, allocated by scheduler initialization) (Protected by InterlockedOr/And) | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerYieldCurrent:array of LongBool;</code> | ||
+ | | style="width: 40%;"|Scheduler yield to current priority level status (One per CPU, allocated by scheduler initialization) | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerStarvationNext:array of LongWord;</code> | ||
+ | | style="width: 40%;"|Scheduler starvation priority round robin (One per CPU, allocated by scheduler initialization) | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerStarvationQuantum:array of LongWord;</code> | ||
+ | | style="width: 40%;"|Quantum for thread starvation checks per CPU (One per CPU, allocated by scheduler initialization) | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerNoneQueue:array of TQueueHandle;</code> | ||
+ | | style="width: 40%;"|Queue of threads that are ready to run at priority level none (One per CPU, allocated by scheduler initialization) | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerIdleQueue:array of TQueueHandle;</code> | ||
+ | | style="width: 40%;"|Queue of threads that are ready to run at priority level idle (One per CPU, allocated by scheduler initialization) | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerLowestQueue:array of TQueueHandle;</code> | ||
+ | | style="width: 40%;"|Queue of threads that are ready to run at priority level lowest (One per CPU, allocated by scheduler initialization) | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerLowerQueue:array of TQueueHandle;</code> | ||
+ | | style="width: 40%;"|Queue of threads that are ready to run at priority level lower (One per CPU, allocated by scheduler initialization) | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerNormalQueue:array of TQueueHandle;</code> | ||
+ | | style="width: 40%;"|Queue of threads that are ready to run at priority level normal (One per CPU, allocated by scheduler initialization) | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerHigherQueue:array of TQueueHandle;</code> | ||
+ | | style="width: 40%;"|Queue of threads that are ready to run at priority level higher (One per CPU, allocated by scheduler initialization) | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerHighestQueue:array of TQueueHandle;</code> | ||
+ | | style="width: 40%;"|Queue of threads that are ready to run at priority level highest (One per CPU, allocated by scheduler initialization) | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerCriticalQueue:array of TQueueHandle;</code> | ||
+ | | style="width: 40%;"|Queue of threads that are ready to run at priority level critical (One per CPU, allocated by scheduler initialization) | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerSleepQueue:array of TQueueHandle;</code> | ||
+ | | style="width: 40%;"|Queue of threads that are currently sleeping (One per CPU, allocated by scheduler initialization) | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerTimeoutQueue:array of TQueueHandle;</code> | ||
+ | | style="width: 40%;"|Queue of threads that are currently waiting with a timeout (One per CPU, allocated by scheduler initialization) | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerTerminationQueue:array of TQueueHandle;</code> | ||
+ | | style="width: 40%;"|Queue of threads that have been terminated (One per CPU, allocated by scheduler initialization) | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerLast:array of LongWord;</code> | ||
+ | | style="width: 40%;"|The timer value of the last scheduler interrupt (One per CPU, allocated by scheduler initialization) | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerInterrupts:array of LongWord;</code> | ||
+ | | style="width: 40%;"|Current number of scheduler interrupts per CPU (When this reaches SCHEDULER_INTERRUPTS_PER_SECOND then UtilizationLast is updated and UtilizationCurrent is reset) (One per CPU, allocated by scheduler initialization) | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Scheduler debug''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerInterruptCounter:array of Int64;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerInterruptOffset:array of LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerInterruptMinOffset:array of LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerInterruptMaxOffset:array of LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerInterruptRollover:array of LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerSelectEntry:array of Int64;</code> | ||
+ | | style="width: 40%;"|Number of times the scheduler select routine has been called (One per CPU) | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerSelectYield:array of Int64;</code> | ||
+ | | style="width: 40%;"|Number of times the scheduler select routine has been called with yield equal to true (One per CPU) | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerSelectForce:array of Int64;</code> | ||
+ | | style="width: 40%;"|Number of times the scheduler forced a thread switch due to starvation quantum (One per CPU) | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerSelectNoMask:array of Int64;</code> | ||
+ | | style="width: 40%;"|Number of times the scheduler selection encountered an empty priority mask (Should never happen)(One per CPU) | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerSelectNormal:array of Int64;</code> | ||
+ | | style="width: 40%;"|Number of times the scheduler selection used normal next highest priority to select thread (One per CPU) | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerSelectInvalid:array of Int64;</code> | ||
+ | | style="width: 40%;"|Number of times the scheduler selection resulted in INVALID_THREAD_HANDLE (Should never happen)(One per CPU) | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerSelectFailure:array of Int64;</code> | ||
+ | | style="width: 40%;"|Number of times the scheduler failed to enqueue the currently running thread (Should never happen)(One per CPU) | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerSelectNoReady:array of Int64;</code> | ||
+ | | style="width: 40%;"|Number of times the scheduler selection found no ready thread available to run (Should never happen)(One per CPU) | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerSelectDefaulted:array of Int64;</code> | ||
+ | | style="width: 40%;"|Number of times the scheduler selection defaulted to an IDLE or NONE thread (Should never happen)(One per CPU) | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerStarvationReset:array of Int64;</code> | ||
+ | | style="width: 40%;"|Number of times the scheduler reset the starvation quantum (One per CPU) | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerStarvationDecrement:array of Int64;</code> | ||
+ | | style="width: 40%;"|Number of times the scheduler decremented the starvation quantum (One per CPU) | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerSelectCPU:array of Int64;</code> | ||
+ | | style="width: 40%;"|Number of times the scheduler selection changed the CurrentCPU on a running thread (One per CPU) | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerSelectPriority:array of Int64;</code> | ||
+ | | style="width: 40%;"|Number of times the scheduler selection changed the Priority on a running thread (One per CPU) | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerSelectAffinity:array of Int64;</code> | ||
+ | | style="width: 40%;"|Number of times the scheduler selection changed the CurrentCPU on a running thread due to Affinity mismatch (One per CPU) | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerSwitchEntry:array of Int64;</code> | ||
+ | | style="width: 40%;"|Number of times the scheduler switch routine has been called (One per CPU) | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerSwitchThread:array of TThreadHandle;</code> | ||
+ | | style="width: 40%;"|The thread returned by scheduler select on the last scheduler switch call (One per CPU) | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerSwitchCounter:array of Int64;</code> | ||
+ | | style="width: 40%;"|Number of times the scheduler switch resulted in a thread switch (One per CPU) | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerSwitchCurrent:array of Int64;</code> | ||
+ | | style="width: 40%;"|Number of times the scheduler switch resulted in the current thread continuing (One per CPU) | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerSwitchInvalid:array of Int64;</code> | ||
+ | | style="width: 40%;"|Number of times the scheduler switch was returned INVALID_THREAD_HANDLE by scheduler select (Should never happen)(One per CPU) | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerRescheduleEntry:array of Int64;</code> | ||
+ | | style="width: 40%;"|Number of times the scheduler reschedule routine has been called (One per CPU) | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerRescheduleThread:array of TThreadHandle;</code> | ||
+ | | style="width: 40%;"|The thread returned by scheduler select on the last scheduler reschedule call (One per CPU) | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerRescheduleCounter:array of Int64;</code> | ||
+ | | style="width: 40%;"|Number of times the scheduler reschedule resulted in a thread switch (One per CPU) | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerRescheduleCurrent:array of Int64;</code> | ||
+ | | style="width: 40%;"|Number of times the scheduler reschedule resulted in the current thread continuing (One per CPU) | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerRescheduleInvalid:array of Int64;</code> | ||
+ | | style="width: 40%;"|Number of times the scheduler reschedule was returned INVALID_THREAD_HANDLE by scheduler select (Should never happen)(One per CPU) | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerMigrationCounter:Int64;</code> | ||
+ | | style="width: 40%;"|Number of times scheduler select invoked a thread migration (CPU 0 only) | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerTerminationCounter:array of Int64;</code> | ||
+ | | style="width: 40%;"|Number of threads destroyed by scheduler reschedule (After termination quantum)(One per CPU) | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerSecondaryWaitCounter:array of Int64;</code> | ||
+ | | style="width: 40%;"|Number of wait cycles performed by secondary CPUs while waiting for init completion (One per CPU) | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Lock debug''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SpinDeadlockCounter:Int64;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SpinRecursionCounter:Int64;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SpinRecursionThread:TThreadHandle;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SpinIRQThreadCounter:Int64;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SpinFIQThreadCounter:Int64;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SpinSWIThreadCounter:Int64;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SpinIdleThreadCounter:Int64;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>MutexDeadlockCounter:Int64;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>MutexRecursionCounter:Int64;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>MutexRecursionThread:TThreadHandle;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>MutexIRQThreadCounter:Int64;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>MutexFIQThreadCounter:Int64;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>MutexSWIThreadCounter:Int64;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>MutexIdleThreadCounter:Int64;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>CriticalSectionDeadlockCounter:Int64;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SemaphoreDeadlockCounter:Int64;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SynchronizerDeadlockCounter:Int64;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SynchronizerRecursionCounter:Int64;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>ConditionDeadlockCounter:Int64;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>CompletionDeadlockCounter:Int64;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>MessageslotDeadlockCounter:Int64;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>MailslotDeadlockCounter:Int64;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>BufferDeadlockCounter:Int64;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>EventDeadlockCounter:Int64;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Spin debug''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SpinLockEntry:LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SpinUnlockEntry:LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SpinLockExit:LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SpinUnlockExit:LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SpinUnlockNoLock:LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SpinUnlockNoOwner:LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SpinLockCounter:LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SpinUnlockCounter:LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SpinDestroyCounter:LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SpinLockIRQCounter:LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SpinUnlockIRQCounter:LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SpinLockFIQCounter:LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SpinUnlockFIQCounter:LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SpinLockIRQFIQCounter:LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SpinUnlockIRQFIQCounter:LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Mutex debug''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>MutexLockEntry:LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>MutexUnlockEntry:LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>MutexLockExit:LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>MutexUnlockExit:LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>MutexUnlockNoLock:LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>MutexUnlockNoOwner:LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>MutexLockCounter:LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>MutexUnlockCounter:LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>MutexDestroyCounter:LongWord;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Heap manager variables''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>HeapLock:THeapLock;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''RTL thread manager variables''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>ThreadVarBlockSize:DWORD;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Initialization handlers''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>PrimaryInitHandler:TPrimaryInit;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerInitHandler:TSchedulerInit;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerStartHandler:TSchedulerStart;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SecondaryInitHandler:TSecondaryInit;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SecondaryBootHandler:TSecondaryBoot;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''SpinLock/Unlock handlers''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SpinLockHandler:TSpinLock;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SpinUnlockHandler:TSpinUnlock;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SpinLockIRQHandler:TSpinLockIRQ;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SpinUnlockIRQHandler:TSpinUnlockIRQ;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SpinLockFIQHandler:TSpinLockFIQ;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SpinUnlockFIQHandler:TSpinUnlockFIQ;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SpinLockIRQFIQHandler:TSpinLockIRQFIQ;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SpinUnlockIRQFIQHandler:TSpinUnlockIRQFIQ;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SpinCheckIRQHandler:TSpinCheckIRQ;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SpinCheckFIQHandler:TSpinCheckFIQ;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SpinExchangeIRQHandler:TSpinExchangeIRQ;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SpinExchangeFIQHandler:TSpinExchangeFIQ;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SpinMaskExchangeHandler:TSpinMaskExchange;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''MutexLock/Unlock handlers''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>MutexLockHandler:TMutexLock;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>MutexUnlockHandler:TMutexUnlock;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>MutexTryLockHandler:TMutexTryLock;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''CriticalSection Lock/Unlock/TryLock handlers''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>CriticalSectionLockHandler:TCriticalSectionLock;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>CriticalSectionLockExHandler:TCriticalSectionLockEx;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>CriticalSectionUnlockHandler:TCriticalSectionUnlock;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>CriticalSectionTryLockHandler:TCriticalSectionTryLock;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Semaphore Wait/Signal handlers''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SemaphoreWaitHandler:TSemaphoreWait;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SemaphoreWaitExHandler:TSemaphoreWaitEx;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SemaphoreSignalHandler:TSemaphoreSignal;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Synchronizer Reader/WriterLock/Unlock handlers''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SynchronizerReaderLockHandler:TSynchronizerLock;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SynchronizerWriterLockHandler:TSynchronizerLock;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SynchronizerReaderLockExHandler:TSynchronizerLockEx;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SynchronizerWriterLockExHandler:TSynchronizerLockEx;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SynchronizerReaderUnlockHandler:TSynchronizerUnlock;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SynchronizerWriterUnlockHandler:TSynchronizerUnlock;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SynchronizerReaderConvertHandler:TSynchronizerConvert;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SynchronizerWriterConvertHandler:TSynchronizerConvert;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SynchronizerReaderConvertExHandler:TSynchronizerConvertEx;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Condition Wait/Wake/WakeAll Handlers''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>ConditionWaitHandler:TConditionWait;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>ConditionWaitMutexHandler:TConditionWaitMutex;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>ConditionWaitSynchronizerHandler:TConditionWaitSynchronizer;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>ConditionWaitCriticalSectionHandler:TConditionWaitCriticalSection;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>ConditionWakeHandler:TConditionWake;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>ConditionWakeAllHandler:TConditionWakeAll;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Completion Wait/TryWait/Reset/Complete/CompleteAll Handlers''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>CompletionWaitHandler:TCompletionWait;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>CompletionTryWaitHandler:TCompletionTryWait;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>CompletionResetHandler:TCompletionReset;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>CompletionCompleteHandler:TCompletionComplete;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>CompletionCompleteAllHandler:TCompletionCompleteAll;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Messageslot send and receive handlers''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>MessageslotSendHandler:TMessageslotSend;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>MessageslotReceiveHandler:TMessageslotReceive;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>MessageslotReceiveExHandler:TMessageslotReceiveEx;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Mailslot send and receive handlers''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>MailslotSendHandler:TMailslotSend;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>MailslotSendExHandler:TMailslotSendEx;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>MailslotReceiveHandler:TMailslotReceive;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>MailslotReceiveExHandler:TMailslotReceiveEx;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Buffer Get/GetEx/Free handlers''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>BufferGetHandler:TBufferGet;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>BufferGetExHandler:TBufferGetEx;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>BufferFreeHandler:TBufferFree;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>BufferIterateHandler:TBufferIterate;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Event Wait/Set/Reset/Pulse handlers''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>EventWaitHandler:TEventWait;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>EventWaitExHandler:TEventWaitEx;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>EventSetHandler:TEventSet;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>EventResetHandler:TEventReset;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>EventPulseHandler:TEventPulse;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Timer Enable/Disable/Check/Trigger handlers''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TimerEnableHandler:TTimerEnable;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TimerEnableExHandler:TTimerEnableEx;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TimerDisableHandler:TTimerDisable;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TimerCheckHandler:TTimerCheck;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TimerTriggerHandler:TTimerTrigger;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Tasker Check/Trigger handlers''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TaskerCheckHandler:TTaskerCheck;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TaskerTriggerHandler:TTaskerTrigger;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Thread Get/SetCurrent handlers''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>ThreadGetCurrentHandler:TThreadGetCurrent;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>ThreadSetCurrentHandler:TThreadSetCurrent;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Scheduler Check/Wakeup/Expire/Select/Switch handlers''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerCheckHandler:TSchedulerCheck;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerWakeupHandler:TSchedulerWakeup;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerExpireHandler:TSchedulerExpire;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerSwitchHandler:TSchedulerSwitch;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerSelectHandler:TSchedulerSelect;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerRescheduleHandler:TSchedulerReschedule;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerMigrationEnableHandler:TSchedulerMigrationEnable;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerMigrationDisableHandler:TSchedulerMigrationDisable;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerPreemptEnableHandler:TSchedulerPreemptEnable;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerPreemptDisableHandler:TSchedulerPreemptDisable;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerAllocationEnableHandler:TSchedulerAllocationEnable;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SchedulerAllocationDisableHandler:TSchedulerAllocationDisable;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''Thread SetupStack handlers''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>ThreadSetupStackHandler:TThreadSetupStack;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | <br /> | ||
=== Function declarations === | === Function declarations === | ||
---- | ---- | ||
− | |||
+ | '''Initialization functions''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure LocksInit;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Initialize Locks</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | Called only during system startup | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure ThreadsInit;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Initialize Threading</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | Called only during system startup | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure PrimaryInit;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Initialize the primary CPU</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | Called only during system startup | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure SchedulerInit;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Initialize the thread scheduler</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | Called only during system startup | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure SchedulerStart(CPUID:LongWord);</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Initialize the thread scheduler for secondary CPUs (Where Applicable)</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | Called only during system startup | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure SecondaryInit;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Initialize the secondary CPUs (Where Applicable)</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | Called only during system startup | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure SecondaryBoot(CPUID:LongWord);</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Boot the specified secondary CPU (Where Applicable)</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | Called only during system startup | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure SecondaryStart(CPUID:LongWord);</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Startup procedure for secondary CPUs (Where Applicable)</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | The Secondary Boot procedure should have already cleared L1 cache, enabled FPU, MMU, Vectors and PageTables before calling this function. The thread Id of the IRQ or FIQ should also have been loaded into the appropriate registers. | ||
+ | Called only during system startup. | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function IRQExecute(Parameter:Pointer):PtrInt;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' IRQ thread function</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | Not intended to be called directly by applications | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function FIQExecute(Parameter:Pointer):PtrInt;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' FIQ thread function</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | Not intended to be called directly by applications | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SWIExecute(Parameter:Pointer):PtrInt;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' SWI thread function</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | Not intended to be called directly by applications | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function IdleExecute(Parameter:Pointer):PtrInt;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Idle thread function</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | Not intended to be called directly by applications | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function MainExecute(Parameter:Pointer):PtrInt;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Main thread function</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | Not intended to be called directly by applications | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TimerExecute(Parameter:Pointer):PtrInt;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Timer thread function</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | Not intended to be called directly by applications | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function WorkerExecute(Parameter:Pointer):PtrInt;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Worker thread function</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | Not intended to be called directly by applications | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TimerPriorityExecute(Parameter:Pointer):PtrInt;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Priority Timer thread function</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | Not intended to be called directly by applications | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function WorkerPriorityExecute(Parameter:Pointer):PtrInt;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Priority Worker thread function</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | Not intended to be called directly by applications | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function IdleCalibrate:LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Calibrate the idle thread loop by counting the number of loops in 100ms</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | Called only during system startup | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | |||
+ | '''Spin functions''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SpinCreate:TSpinHandle;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create and insert a new Spin entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Return | ||
+ | | Handle of new Spin entry or INVALID_HANDLE_VALUE if entry could not be created | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SpinCreateEx(InitialOwner:Boolean):TSpinHandle;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create and insert a new Spin entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! InitialOwner | ||
+ | | If true set the state of the spin to locked and the owner to the current thread | ||
+ | |- | ||
+ | ! Return | ||
+ | | Handle of new Spin entry or INVALID_HANDLE_VALUE if entry could not be created | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SpinDestroy(Spin:TSpinHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Destroy and remove an existing Spin entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Spin | ||
+ | | Handle of Spin entry to destroy | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SpinOwner(Spin:TSpinHandle):TThreadHandle;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current owner of an existing Spin entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Spin | ||
+ | | Handle of Spin entry to get owner for | ||
+ | |- | ||
+ | ! Return | ||
+ | | Handle of owning thread or INVALID_HANDLE_VALUE if not currently owned | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SpinLock(Spin:TSpinHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Lock an existing Spin entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Spin | ||
+ | | Handle of Spin entry to lock | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SpinUnlock(Spin:TSpinHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Unlock an existing Spin entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Spin | ||
+ | | Handle of Spin entry to unlock | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SpinLockIRQ(Spin:TSpinHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Lock an existing Spin entry, disable IRQ and save the previous IRQ state</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Spin | ||
+ | | Handle of Spin entry to lock | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SpinUnlockIRQ(Spin:TSpinHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Unlock an existing Spin entry and restore the previous IRQ state</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Spin | ||
+ | | Handle of Spin entry to unlock | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SpinLockFIQ(Spin:TSpinHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Lock an existing Spin entry, disable FIQ and save the previous FIQ state</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Spin | ||
+ | | Handle of Spin entry to lock | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SpinUnlockFIQ(Spin:TSpinHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Unlock an existing Spin entry and restore the previous FIQ state</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Spin | ||
+ | | Handle of Spin entry to unlock | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SpinLockIRQFIQ(Spin:TSpinHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Lock an existing Spin entry, disable IRQ and FIQ and save the previous IRQ and FIQ state</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Spin | ||
+ | | Handle of Spin entry to lock | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SpinUnlockIRQFIQ(Spin:TSpinHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Unlock an existing Spin entry and restore the previous IRQ and FIQ state</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Spin | ||
+ | | Handle of Spin entry to unlock | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SpinLockPreempt(Spin:TSpinHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Lock an existing Spin entry, disable IRQ or IRQ/FIQ and save the previous IRQ or IRQ/FIQ state</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Spin | ||
+ | | Handle of Spin entry to lock | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | This is a convenience wrapper which determines the appropriate SpinLock call to disable preemption | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SpinUnlockPreempt(Spin:TSpinHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Unlock an existing Spin entry and restore the previous IRQ or IRQ/FIQ state</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Spin | ||
+ | | Handle of Spin entry to unlock | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | This is a convenience wrapper which determines the appropriate SpinUnlock call to enable preemption | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SpinCheckIRQ(Spin:TSpinHandle):Boolean;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Check the mask that stores the previous IRQ state to determine if IRQ is enabled</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Spin | ||
+ | | Handle of Spin entry to check | ||
+ | |- | ||
+ | ! Return | ||
+ | | True if the mask would enable IRQ on restore, False if it would not | ||
+ | |- | ||
+ | ! Note | ||
+ | | The Spin entry must be locked by the current thread | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SpinCheckFIQ(Spin:TSpinHandle):Boolean;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Check the mask that stores the previous FIQ state to determine if FIQ is enabled</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Spin | ||
+ | | Handle of Spin entry to check | ||
+ | |- | ||
+ | ! Return | ||
+ | | True if the mask would enable FIQ on restore, False if it would not | ||
+ | |- | ||
+ | ! Note | ||
+ | | The Spin entry must be locked by the current thread | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SpinExchangeIRQ(Spin1,Spin2:TSpinHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Exchange the previous IRQ state between two Spin entries</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Spin1 | ||
+ | | Handle of first Spin entry | ||
+ | |- | ||
+ | ! Spin2 | ||
+ | | Handle of second Spin entry | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | Both Spin entries must be locked by the current thread | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SpinExchangeFIQ(Spin1,Spin2:TSpinHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Exchange the previous FIQ state between two Spin entries</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Spin1 | ||
+ | | Handle of first Spin entry | ||
+ | |- | ||
+ | ! Spin2 | ||
+ | | Handle of second Spin entry | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | Both Spin entries must be locked by the current thread | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SpinLockDefault(SpinEntry:PSpinEntry):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Default version of SpinLock function used if no handler is registered</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | Not intended to be called directly by applications, use SpinLock instead | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SpinUnlockDefault(SpinEntry:PSpinEntry):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Default version of SpinUnlock function used if no handler is registered</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | Not intended to be called directly by applications, use SpinUnlock instead | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SpinLockIRQDefault(SpinEntry:PSpinEntry):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Default version of SpinLockIRQ function used if no handler is registered</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | Not intended to be called directly by applications, use SpinLockIRQ instead | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SpinUnlockIRQDefault(SpinEntry:PSpinEntry):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Default version of SpinUnlockIRQ function used if no handler is registered</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | Not intended to be called directly by applications, use SpinUnlockIRQ instead | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SpinLockFIQDefault(SpinEntry:PSpinEntry):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Default version of SpinLockFIQ function used if no handler is registered</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | Not intended to be called directly by applications, use SpinLockFIQ instead | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SpinUnlockFIQDefault(SpinEntry:PSpinEntry):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Default version of SpinUnlockFIQ function used if no handler is registered</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | Not intended to be called directly by applications, use SpinUnlockFIQ instead | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SpinLockIRQFIQDefault(SpinEntry:PSpinEntry):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Default version of SpinLockIRQFIQ function used if no handler is registered</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | Not intended to be called directly by applications, use SpinLockIRQFIQ instead | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SpinUnlockIRQFIQDefault(SpinEntry:PSpinEntry):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Default version of SpinUnlockIRQFIQ function used if no handler is registered</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | Not intended to be called directly by applications, use SpinUnlockIRQFIQ instead | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | |||
+ | '''Mutex functions''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function MutexCreate:TMutexHandle;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create and insert a new Mutex entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Return | ||
+ | | Handle of new Mutex entry or INVALID_HANDLE_VALUE if entry could not be created | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function MutexCreateEx(InitialOwner:Boolean; SpinCount:LongWord; Flags:LongWord):TMutexHandle;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create and insert a new Mutex entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! InitialOwner | ||
+ | | If true set the state of the mutex to locked and the owner to the current thread | ||
+ | |- | ||
+ | ! SpinCount | ||
+ | | The number of times the mutex will spin before yielding (Always 0 if CPU count equals 1) | ||
+ | |- | ||
+ | ! Flags | ||
+ | | The flags for the Mutex entry (eg MUTEX_FLAG_RECURSIVE) | ||
+ | |- | ||
+ | ! Return | ||
+ | | Handle of new Mutex entry or INVALID_HANDLE_VALUE if entry could not be created | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function MutexDestroy(Mutex:TMutexHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Destroy and remove an existing Mutex entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Mutex | ||
+ | | Handle of Mutex entry to destroy | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function MutexFlags(Mutex:TMutexHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current flags of an existing Mutex entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Mutex | ||
+ | | Handle of Mutex entry to get flags for | ||
+ | |- | ||
+ | ! Return | ||
+ | | Current flags or INVALID_HANDLE_VALUE on error | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function MutexCount(Mutex:TMutexHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current lock count of an existing Mutex entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Mutex | ||
+ | | Mutex to get count for | ||
+ | |- | ||
+ | ! Return | ||
+ | | Current lock count or INVALID_HANDLE_VALUE on error | ||
+ | |- | ||
+ | ! Note | ||
+ | | Count is only valid if Flags includes MUTEX_FLAG_RECURSIVE | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function MutexOwner(Mutex:TMutexHandle):TThreadHandle;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current owner of an existing Mutex entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Mutex | ||
+ | | Handle of Mutex entry to get owner for | ||
+ | |- | ||
+ | ! Return | ||
+ | | Handle of owning thread or INVALID_HANDLE_VALUE if not currently owned | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function MutexLock(Mutex:TMutexHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Lock an existing Mutex entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Mutex | ||
+ | | Handle of Mutex entry to lock | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function MutexUnlock(Mutex:TMutexHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Unlock an existing Mutex entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Mutex | ||
+ | | Handle of Mutex entry to unlock | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function MutexTryLock(Mutex:TMutexHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Try to lock an existing Mutex entry. If the Mutex is not locked then lock it and mark the owner as the current thread. If the Mutex is already locked then return immediately with an error and do not wait for it to be unlocked.</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Mutex | ||
+ | | Mutex to try to lock | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed, ERROR_LOCKED if already locked or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function MutexLockDefault(MutexEntry:PMutexEntry):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Default version of MutexLock function used if no handler is registered</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | Not intended to be called directly by applications, use MutexLock instead | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function MutexUnlockDefault(MutexEntry:PMutexEntry):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Default version of MutexUnlock function used if no handler is registered</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | Not intended to be called directly by applications, use MutexUnlock instead | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function MutexTryLockDefault(MutexEntry:PMutexEntry):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Default version of MutexTryLock function used if no handler is registered</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | Not intended to be called directly by applications, use MutexTryLock instead | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | |||
+ | '''Critical section functions''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function CriticalSectionCreate:TCriticalSectionHandle;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create and insert a new CriticalSection entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Return | ||
+ | | Handle of new CriticalSection entry or INVALID_HANDLE_VALUE if entry could not be created | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function CriticalSectionCreateEx(InitialOwner:Boolean; SpinCount:LongWord):TCriticalSectionHandle;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create and insert a new CriticalSection entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! CriticalSection | ||
+ | | If true set the state of the criticalsection to locked and the owner to the current thread | ||
+ | |- | ||
+ | ! SpinCount | ||
+ | | The number of times the criticalsection will spin before waiting (Always 0 if CPU count equals 1) | ||
+ | |- | ||
+ | ! Return | ||
+ | | Handle of new CriticalSection entry or INVALID_HANDLE_VALUE if entry could not be created | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function CriticalSectionDestroy(CriticalSection:TCriticalSectionHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Destroy and remove an existing CriticalSection entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! CriticalSection | ||
+ | | Handle of CriticalSection entry to destroy | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function CriticalSectionCount(CriticalSection:TCriticalSectionHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current lock count of an existing CriticalSection entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! CriticalSection | ||
+ | | CriticalSection to get count for | ||
+ | |- | ||
+ | ! Return | ||
+ | | Current lock count or INVALID_HANDLE_VALUE on error | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function CriticalSectionOwner(CriticalSection:TCriticalSectionHandle):TThreadHandle;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current owner of an existing CriticalSection entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! CriticalSection | ||
+ | | CriticalSection to get owner for | ||
+ | |- | ||
+ | ! Return | ||
+ | | Handle of owning thread or INVALID_HANDLE_VALUE if not currently owned | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function CriticalSectionSetSpinCount(CriticalSection:TCriticalSectionHandle; SpinCount:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the spin count of an existing CriticalSection entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! CriticalSection | ||
+ | | CriticalSection to set spin count for | ||
+ | |- | ||
+ | ! SpinCount | ||
+ | | The spin count value to set | ||
+ | |- | ||
+ | ! Return | ||
+ | | Current spin count or INVALID_HANDLE_VALUE on error | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function CriticalSectionLock(CriticalSection:TCriticalSectionHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Lock an existing CriticalSection entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! CriticalSection | ||
+ | | CriticalSection to lock | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | If the CriticalSection is not locked then lock it, set the count to one and mark the owner as the current thread. If the CriticalSection is already locked by the current thread then increment the count and return immediately. If the CriticalSection is already locked by another thread then wait until it is unlocked. | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function CriticalSectionLockEx(CriticalSection:TCriticalSectionHandle; Timeout:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Lock an existing CriticalSection entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! CriticalSection | ||
+ | | CriticalSection to lock | ||
+ | |- | ||
+ | ! Timeout | ||
+ | | Milliseconds to wait before timeout (0 equals do not wait, INFINITE equals wait forever) | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | If the CriticalSection is not locked then lock it, set the count to one and mark the owner as the current thread. If the CriticalSection is already locked by the current thread then increment the count and return immediately. If the CriticalSection is already locked by another thread then wait until it is unlocked. | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function CriticalSectionUnlock(CriticalSection:TCriticalSectionHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Unlock an existing CriticalSection entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! CriticalSection | ||
+ | | CriticalSection to unlock | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | If the CriticalSection is locked by the current thread then decrement the count. If the count is greater than zero then return immediately. If the count reaches zero then unlock the CriticalSection and release the first thread waiting for it to be unlocked. If the CriticalSection is locked by another thread then return an error. If the CriticalSection is not locked then return an error. | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function CriticalSectionTryLock(CriticalSection:TCriticalSectionHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Try to lock an existing CriticalSection entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! CriticalSection | ||
+ | | CriticalSection to try to lock | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed, ERROR_LOCKED if locked by another thread or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | If the CriticalSection is not locked then lock it, set the count to one and mark the owner as the current thread. If the CriticalSection is already locked by the current thread then increment the count and return immediately. If the CriticalSection is already locked by another thread then return immediately with an error and do not wait for it to be unlocked. | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | |||
+ | '''Semaphore functions''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SemaphoreCreate(Count:LongWord):TSemaphoreHandle;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create and insert a new Semaphore entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Count | ||
+ | | The initial count of the Semaphore (Must be greater than or equal to zero) | ||
+ | |- | ||
+ | ! Return | ||
+ | | Handle of new Semaphore entry or INVALID_HANDLE_VALUE if entry could not be created | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SemaphoreCreateEx(Count,Maximum:LongWord; Flags:LongWord):TSemaphoreHandle;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create and insert a new Semaphore entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Count | ||
+ | | The initial count of the Semaphore (Must be greater than or equal to zero) | ||
+ | |- | ||
+ | ! Maximum | ||
+ | | The maximum count of the Semaphore (Must be greater than one) | ||
+ | |- | ||
+ | ! Flags | ||
+ | | The flags for the Semaphore entry (eg SEMAPHORE_FLAG_IRQ) | ||
+ | |- | ||
+ | ! Return | ||
+ | | Handle of new Semaphore entry or INVALID_HANDLE_VALUE if entry could not be created | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SemaphoreDestroy(Semaphore:TSemaphoreHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Destroy and remove an existing Semaphore entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Semaphore | ||
+ | | Handle of Semaphore entry to destroy | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SemaphoreCount(Semaphore:TSemaphoreHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current count of an existing Semaphore entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Semaphore | ||
+ | | Semaphore to get count for | ||
+ | |- | ||
+ | ! Return | ||
+ | | Current count or INVALID_HANDLE_VALUE on error | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SemaphoreWait(Semaphore:TSemaphoreHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Wait on an existing Semaphore entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Semaphore | ||
+ | | Semaphore to wait on | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | If the Semaphore count is greater than zero it will be decremented and this function will return immediately. If the Semaphore count is zero the current thread will be put on a wait queue until the Semaphore is signalled by another thread calling SemaphoreSignal() or SemaphoreSignalEx(). | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SemaphoreWaitEx(Semaphore:TSemaphoreHandle; Timeout:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Wait on an existing Semaphore entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Semaphore | ||
+ | | Semaphore to wait on | ||
+ | |- | ||
+ | ! Timeout | ||
+ | | Milliseconds to wait before timeout (0 equals do not wait, INFINITE equals wait forever) | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | If the Semaphore count is greater than zero it will be decremented and this function will return immediately. If the Semaphore count is zero the current thread will be put on a wait queue until the Semaphore is signalled by another thread calling SemaphoreSignal() or SemaphoreSignalEx(). | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SemaphoreSignal(Semaphore:TSemaphoreHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Signal an existing Semaphore entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Semaphore | ||
+ | | Semaphore to signal | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | If any threads are waiting on the Semaphore then one thread will be woken up and placed on the ready queue. If no threads are waiting then the Semaphore count will be incremented by one. | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SemaphoreSignalEx(Semaphore:TSemaphoreHandle; Count:LongWord; Previous:PLongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Signal an existing Semaphore entry one or more times</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Semaphore | ||
+ | | Semaphore to signal | ||
+ | |- | ||
+ | ! Count | ||
+ | | The number is times to signal the Semaphore, must be greater than zero. | ||
+ | |- | ||
+ | ! Previous | ||
+ | | A pointer to a value that receives the previous count of the Semaphore. Can be nil if the previous count is not required. | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | If any threads are waiting on the Semaphore then one thread will be woken up and placed on the ready queue for each iteration of the count passed. If no threads are waiting then the Semaphore count will be incremented once for each iteration of the count passed. | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | |||
+ | '''Synchronizer functions''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SynchronizerCreate:TSynchronizerHandle;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create and insert a new Synchronizer entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Return | ||
+ | | Handle of new Synchronizer entry or INVALID_HANDLE_VALUE if entry could not be created | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SynchronizerCreateEx(InitialReader,InitialWriter:Boolean):TSynchronizerHandle;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create and insert a new Synchronizer entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! InitialReader | ||
+ | | If true set the state of the synchronizer to locked and the reader count to 1 | ||
+ | |- | ||
+ | ! InitialWriter | ||
+ | | If true set the state of the synchronizer to locked and the writer owner to the current thread | ||
+ | |- | ||
+ | ! Return | ||
+ | | Handle of new Synchronizer entry or INVALID_HANDLE_VALUE if entry could not be created | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SynchronizerDestroy(Synchronizer:TSynchronizerHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Destroy and remove an existing Synchronizer entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Synchronizer | ||
+ | | Handle of Synchronizer entry to destroy | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SynchronizerReaderCount(Synchronizer:TSynchronizerHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current reader count of an existing Synchronizer entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Synchronizer | ||
+ | | Synchronizer to get count for | ||
+ | |- | ||
+ | ! Return | ||
+ | | Current reader count or INVALID_HANDLE_VALUE on error | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SynchronizerReaderLast(Synchronizer:TSynchronizerHandle):TThreadHandle;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the last reader thread of an existing Synchronizer entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Synchronizer | ||
+ | | Synchronizer to last reader for | ||
+ | |- | ||
+ | ! Return | ||
+ | | Last reader thread or INVALID_HANDLE_VALUE on error | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SynchronizerReaderLock(Synchronizer:TSynchronizerHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Lock an existing Synchronizer entry for reading</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Synchronizer | ||
+ | | Synchronizer to lock | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | If the Synchronizer is not locked then lock it and set the reader count to one. If the Synchronizer is already locked for reading then increment the reader count and return immediately. If the Synchronizer is already locked for writing then wait until it is unlocked. | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SynchronizerReaderLockEx(Synchronizer:TSynchronizerHandle; Timeout:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Lock an existing Synchronizer entry for reading</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Synchronizer | ||
+ | | Synchronizer to lock | ||
+ | |- | ||
+ | ! Timeout | ||
+ | | Milliseconds to wait before timeout (0 equals do not wait, INFINITE equals wait forever) | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | If the Synchronizer is not locked then lock it and set the reader count to one. If the Synchronizer is already locked for reading then increment the reader count and return immediately. If the Synchronizer is already locked for writing then wait until it is unlocked. | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SynchronizerReaderUnlock(Synchronizer:TSynchronizerHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Unlock an existing Synchronizer entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Synchronizer | ||
+ | | Synchronizer to unlock | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | If the Synchronizer is locked for reading then decrement the count. If the count is greater than zero then return immediately. If the count reaches zero then unlock the Synchronizer and release the first writer thread waiting for it to be unlocked. If the Synchronizer is locked for writing then return an error. If the Synchronizer is not locked then return an error. | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SynchronizerReaderConvert(Synchronizer:TSynchronizerHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Convert a reader lock on an existing Synchronizer entry to a writer lock</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Synchronizer | ||
+ | | Synchronizer to convert | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | If the Synchronizer is locked for reading then decrement the count. If the count is greater than zero then wait to acquire the writer lock. If the count reaches zero then convert to writer lock with the current thread as the owner. If the Synchronizer is locked for writing then return an error. If the Synchronizer is not locked then return an error. Since reader locks are recursive but do not maintain reader thread ownership, caller must ensure that one and only one reader lock is held by the current thread. | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SynchronizerReaderConvertEx(Synchronizer:TSynchronizerHandle; Timeout:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Convert a reader lock on an existing Synchronizer entry to a writer lock</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Synchronizer | ||
+ | | Synchronizer to convert | ||
+ | |- | ||
+ | ! Timeout | ||
+ | | Milliseconds to wait before timeout (0 equals do not wait, INFINITE equals wait forever) | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | If the Synchronizer is locked for reading then decrement the count. If the count is greater than zero then wait to acquire the writer lock. If the count reaches zero then convert to writer lock with the current thread as the owner. If the Synchronizer is locked for writing then return an error. If the Synchronizer is not locked then return an error. Since reader locks are recursive but do not maintain reader thread ownership, caller must ensure that one and only one reader lock is held by the current thread. | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SynchronizerWriterCount(Synchronizer:TSynchronizerHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current writer count of an existing Synchronizer entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Synchronizer | ||
+ | | Synchronizer to get count for | ||
+ | |- | ||
+ | ! Return | ||
+ | | Current writer count or INVALID_HANDLE_VALUE on error | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SynchronizerWriterOwner(Synchronizer:TSynchronizerHandle):TThreadHandle;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current writer owner of an existing Synchronizer entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Synchronizer | ||
+ | | Synchronizer to get owner for | ||
+ | |- | ||
+ | ! Return | ||
+ | | Handle of owning thread or INVALID_HANDLE_VALUE if not currently owned | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SynchronizerWriterLock(Synchronizer:TSynchronizerHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Lock an existing Synchronizer entry for writing</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Synchronizer | ||
+ | | Synchronizer to lock | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | If the Synchronizer is not locked then lock it, set the writer count to one and mark the owner as the current thread. If the Synchronizer is already locked by the current thread then increment the writer count and return immediately. If the Synchronizer is already locked for reading then wait until it is unlocked. | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SynchronizerWriterLockEx(Synchronizer:TSynchronizerHandle; Timeout:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Lock an existing Synchronizer entry for writing</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Synchronizer | ||
+ | | Synchronizer to lock | ||
+ | |- | ||
+ | ! Timeout | ||
+ | | Milliseconds to wait before timeout (0 equals do not wait, INFINITE equals wait forever) | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | If the Synchronizer is not locked then lock it, set the writer count to one and mark the owner as the current thread. If the Synchronizer is already locked by the current thread then increment the writer count and return immediately. If the Synchronizer is already locked for reading then wait until it is unlocked. | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SynchronizerWriterUnlock(Synchronizer:TSynchronizerHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Unlock an existing Synchronizer entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Synchronizer | ||
+ | | Synchronizer to unlock | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | If the Synchronizer is locked for writing by the current thread then decrement the count. If the count is greater than zero then return immediately. If the count reaches zero then unlock the Synchronizer and release all reader threads waiting for it to be unlocked or the first writer thread waiting for it to be unlocked. If the Synchronizer is locked for reading then return an error. If the Synchronizer is locked for writing by another thread then return an error. If the Synchronizer is not locked then return an error. | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SynchronizerWriterConvert(Synchronizer:TSynchronizerHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Convert a writer lock on an existing Synchronizer entry to a reader lock</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Synchronizer | ||
+ | | Synchronizer to convert | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | If the Synchronizer is locked for writing by the current thread and the count is one then decrement the count. If the count is greater than one then return an error. If the count reaches zero then convert to reader lock and release all waiting reader threads. If the Synchronizer is locked for reading then return an error. If the Synchronizer is not locked then return an error. Since writer locks are recursive, caller must ensure that one and only one writer lock is held by the current thread. | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | |||
+ | '''Condition functions''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ConditionCreate:TConditionHandle;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create and insert a new Condition entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Return | ||
+ | | Handle of new Condition entry or INVALID_HANDLE_VALUE if entry could not be created | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ConditionDestroy(Condition:TConditionHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Destroy and remove an existing Condition entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Condition | ||
+ | | Handle of Condition entry to destroy | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ConditionWait(Condition:TConditionHandle; Timeout:LongWord = INFINITE):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Wait on an existing Condition</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Condition | ||
+ | | Condition to wait on | ||
+ | |- | ||
+ | ! Timeout | ||
+ | | Time in milliseconds to wait to be woken | ||
+ | 0 = No Wait | ||
+ | <br />INFINITE = Wait Indefinitely | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ConditionWaitMutex(Condition:TConditionHandle; Mutex:TMutexHandle; Timeout:LongWord = INFINITE):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Release a Mutex and Wait on an existing Condition in an atomic operation</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Condition | ||
+ | | Condition to wait on | ||
+ | |- | ||
+ | ! Mutex | ||
+ | | Mutex to release | ||
+ | |- | ||
+ | ! Timeout | ||
+ | | Time in milliseconds to wait to be woken | ||
+ | 0 = No Wait | ||
+ | <br />INFINITE = Wait Indefinitely | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure. | ||
+ | Before returning (with either success or failure) the thread will reacquire the Mutex. | ||
+ | |- | ||
+ | ! Note | ||
+ | | Caller must be the owner of the Mutex with a count of one on entry to this function | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ConditionWaitSynchronizer(Condition:TConditionHandle; Synchronizer:TSynchronizerHandle; Flags:LongWord; Timeout:LongWord = INFINITE):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Release a Synchronizer and Wait on an existing Condition in an atomic operation</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Condition | ||
+ | | Condition to wait on | ||
+ | |- | ||
+ | ! Synchronizer | ||
+ | | Synchronizer to release | ||
+ | |- | ||
+ | ! Flags | ||
+ | | Flags to indicate reader or writer lock for the Synchronizer (eg CONDITION_LOCK_FLAG_WRITER) | ||
+ | |- | ||
+ | ! Timeout | ||
+ | | Time in milliseconds to wait to be woken | ||
+ | 0 = No Wait | ||
+ | <br />INFINITE = Wait Indefinitely | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure. | ||
+ | Before returning (with either success or failure) the thread will reacquire the Synchronizer for either reading or writing depending on the flags value. | ||
+ | |- | ||
+ | ! Note | ||
+ | | Caller must be the owner of the Synchronizer with a count of one on entry to this function and the ownership must match the flags value provided. | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ConditionWaitCriticalSection(Condition:TConditionHandle; CriticalSection:TCriticalSectionHandle; Timeout:LongWord = INFINITE):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Release a Critical Section and Wait on an existing Condition in an atomic operation</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Condition | ||
+ | | Condition to wait on | ||
+ | |- | ||
+ | ! CriticalSection | ||
+ | | Critical Section to release | ||
+ | |- | ||
+ | ! Timeout | ||
+ | | Time in milliseconds to wait to be woken | ||
+ | 0 = No Wait | ||
+ | <br />INFINITE = Wait Indefinitely | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure. | ||
+ | Before returning (with either success or failure) the thread will reacquire the Synchronizer for either reading or writing depending on the flags value. | ||
+ | |- | ||
+ | ! Note | ||
+ | | Caller must be the owner of the Critical Section with a count of one on entry to this function. | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ConditionWake(Condition:TConditionHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Wake one thread waiting on an existing Condition</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Condition | ||
+ | | Condition to wake | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ConditionWakeAll(Condition:TConditionHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Wake all threads waiting on an existing Condition</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Condition | ||
+ | | Condition to wake | ||
+ | |- | ||
+ | ! Note | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | |||
+ | '''Completion functions''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function CompletionLock(Completion:PCompletionEntry):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Internal function to lock an existing Completion entry based on the entry flags</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | Not intended to be called directly by applications | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function CompletionUnlock(Completion:PCompletionEntry):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Internal function to unlock an existing Completion entry based on the entry flags</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | Not intended to be called directly by applications | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function CompletionCreate(Flags:LongWord = COMPLETION_FLAG_NONE):TCompletionHandle;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create and insert a new Completion entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Flags | ||
+ | | The flags for the Completion entry (eg COMPLETION_FLAG_IRQ) | ||
+ | |- | ||
+ | ! Return | ||
+ | | Handle of new Completion entry or INVALID_HANDLE_VALUE if entry could not be created | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function CompletionDestroy(Completion:TCompletionHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Destroy and remove an existing Completion entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Completion | ||
+ | | Handle of Completion entry to destroy | ||
+ | |- | ||
+ | ! Destroy | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function CompletionState(Completion:TCompletionHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current state of an existing Completion entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Completion | ||
+ | | Completion to get the state for | ||
+ | |- | ||
+ | ! Return | ||
+ | | Current state (eg COMPLETION_STATE_COMPLETE) or INVALID_HANDLE_VALUE on error | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function CompletionWait(Completion:TCompletionHandle; Timeout:LongWord = INFINITE):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Wait on an existing Completion</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Completion | ||
+ | | Completion to wait on | ||
+ | |- | ||
+ | ! Timeout | ||
+ | | Time in milliseconds to wait to be woken | ||
+ | 0 = No Wait | ||
+ | <br />INFINITE = Wait Indefinitely | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | If the completion is set (complete) then return immediately with success. If the completion is not set then wait for it to be completed before returning. For counted completions, decrement the count if it is not 0 or -1 after testing if the completion is set. | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function CompletionTryWait(Completion:TCompletionHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Try an existing Completion to see if it is completed</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Completion | ||
+ | | Completion to try | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed, ERROR_NOT_READY if not completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | If the completion is not set (complete) then return immediately with an error and do not wait for it to be completed. | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function CompletionReset(Completion:TCompletionHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Reset (uncomplete) the state of an existing Completion entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Completion | ||
+ | | Completion to reset the state for | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | If the completion is not set then return with no action. If the completion is set then change the state to not set. For counted completions, reset the counter to 0. | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function CompletionComplete(Completion:TCompletionHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set (complete) the state of an existing Completion entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Completion | ||
+ | | Completion to set the state for | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | If the completion is already set then return with no action. If the completion is not set then release one waiting thread (if any) and return. For counted completions, release one waiting thread, if there are no waiting threads increment the count if it is not -1 and return. | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function CompletionCompleteAll(Completion:TCompletionHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set (complete) the state of an existing Completion entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Completion | ||
+ | | Completion to set the state for | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | If the completion is already set then return with no action. If the completion is not set then release all waiting threads (if any) and return. For counted completions, set the count to -1, release all waiting threads (if any) and return. | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | |||
+ | '''List functions''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ListCreate:TListHandle;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create and insert a new List entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Return | ||
+ | | Handle of new List entry or INVALID_HANDLE_VALUE if entry could not be created | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ListCreateEx(ListType:LongWord; Flags:LongWord):TListHandle;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create and insert a new List entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! ListType | ||
+ | | Type of list to create (eg LIST_TYPE_WAIT_SEMAPHORE) | ||
+ | |- | ||
+ | ! Flags | ||
+ | | Flags for the new list (eg LIST_FLAG_IRQ) | ||
+ | |- | ||
+ | ! Return | ||
+ | | Handle of new List entry or INVALID_HANDLE_VALUE if entry could not be created | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ListDestroy(List:TListHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Destroy and remove an existing List entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! List | ||
+ | | Handle of List entry to destroy | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | If list is part of a synchronisation object then caller must hold the lock on the object containing the list | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ListCount(List:TListHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current count from the supplied list</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! List | ||
+ | | Handle of List entry to get from | ||
+ | |- | ||
+ | ! Return | ||
+ | | List count on success or INVALID_HANDLE_VALUE on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ListAddFirst(List:TListHandle; Element:PListElement):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Add the supplied element as the first item in the List</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! List | ||
+ | | Handle of List entry to add to | ||
+ | |- | ||
+ | ! Element | ||
+ | | The list element to be added | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | If list is part of a synchronisation object then caller must hold the lock on the object containing the list | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ListAddLast(List:TListHandle; Element:PListElement):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Add the supplied element as the last item in the List</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! List | ||
+ | | Handle of List entry to add to | ||
+ | |- | ||
+ | ! Element | ||
+ | | The list element to be added | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | If list is part of a synchronisation object then caller must hold the lock on the object containing the list | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ListGetThread(List:TListHandle; Thread:TThreadHandle):PListElement;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Find the supplied thread in the List and return its element</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! List | ||
+ | | Handle of List entry to find from | ||
+ | |- | ||
+ | ! Thread | ||
+ | | The thread handle to be found | ||
+ | |- | ||
+ | ! Return | ||
+ | | List element on success, nil on failure or list empty | ||
+ | |- | ||
+ | ! Note | ||
+ | | If list is part of a synchronisation object then caller must hold the lock on the object containing the list | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ListGetFirst(List:TListHandle):PListElement;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the first element from the List</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! List | ||
+ | | Handle of List entry to get from | ||
+ | |- | ||
+ | ! Return | ||
+ | | List element on success, nil on failure or list empty | ||
+ | |- | ||
+ | ! Note | ||
+ | | If list is part of a synchronisation object then caller must hold the lock on the object containing the list | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ListGetFirstEx(List:TListHandle; Remove:Boolean):PListElement;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the first element from the List</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! List | ||
+ | | Handle of List entry to get from | ||
+ | |- | ||
+ | ! Remove | ||
+ | | If true then remove the element from the list | ||
+ | |- | ||
+ | ! Return | ||
+ | | List element on success, nil on failure or list empty | ||
+ | |- | ||
+ | ! Note | ||
+ | | If list is part of a synchronisation object then caller must hold the lock on the object containing the list | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ListGetLast(List:TListHandle):PListElement;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the last element from the List</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! List | ||
+ | | Handle of List entry to get from | ||
+ | |- | ||
+ | ! Return | ||
+ | | List element on success, nil on failure or list empty | ||
+ | |- | ||
+ | ! Note | ||
+ | | If list is part of a synchronisation object then caller must hold the lock on the object containing the list | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ListGetLastEx(List:TListHandle; Remove:Boolean):PListElement;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the last element from the List</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! List | ||
+ | | Handle of List entry to get from | ||
+ | |- | ||
+ | ! Remove | ||
+ | | If true then remove the element from the list | ||
+ | |- | ||
+ | ! Return | ||
+ | | List element on success, nil on failure or list empty | ||
+ | |- | ||
+ | ! Note | ||
+ | | If list is part of a synchronisation object then caller must hold the lock on the object containing the list | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ListInsert(List:TListHandle; Previous,Element:PListElement):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Insert a new element in the List</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! List | ||
+ | | Handle of List entry to insert into | ||
+ | |- | ||
+ | ! Previous | ||
+ | | The element to insert the new element after | ||
+ | |- | ||
+ | ! Element | ||
+ | | The list element to be inserted | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | If list is part of a synchronisation object then caller must hold the lock on the object containing the list | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ListRemove(List:TListHandle; Element:PListElement):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Remove an element from the List</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! List | ||
+ | | Handle of List entry to remove from | ||
+ | |- | ||
+ | ! Element | ||
+ | | The list element to be removed | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | If list is part of a synchronisation object then caller must hold the lock on the object containing the list | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ListIsEmpty(List:TListHandle):Boolean;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Check if the supplied List is empty</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! List | ||
+ | | Handle of List entry to check | ||
+ | |- | ||
+ | ! Return | ||
+ | | True if List is empty or does not exist, False if List is not empty | ||
+ | |- | ||
+ | ! Note | ||
+ | | If list is part of a synchronisation object then caller must hold the lock on the object containing the list | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ListNotEmpty(List:TListHandle):Boolean;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Check if the supplied List is empty</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! List | ||
+ | | Handle of List entry to check | ||
+ | |- | ||
+ | ! Return | ||
+ | | True if List is not empty, False if List is empty or does not exist | ||
+ | |- | ||
+ | ! Note | ||
+ | | If list is part of a synchronisation object then caller must hold the lock on the object containing the list | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ListLock(List:TListHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Lock the supplied List</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! List | ||
+ | | Handle of List entry to lock | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ListUnlock(List:TListHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Unlock the supplied List</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! List | ||
+ | | Handle of List entry to unlock | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ListLock(List:TListHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Lock the supplied List</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! List | ||
+ | | Handle of List entry to lock | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ListUnlock(List:TListHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Unlock the supplied List</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! List | ||
+ | | Handle of List entry to unlock | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | |||
+ | '''Queue functions''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function QueueCreate:TQueueHandle;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create and insert a new Queue entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Return | ||
+ | | Handle of new Queue entry or INVALID_HANDLE_VALUE if entry could not be created | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function QueueCreateEx(QueueType:LongWord; Flags:LongWord):TQueueHandle;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create and insert a new Queue entry}</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! QueueType | ||
+ | | Type of queue to create (eg QUEUE_TYPE_SCHEDULE_SLEEP) | ||
+ | |- | ||
+ | ! Flags | ||
+ | | Flags for the new queue (eg QUEUE_FLAG_DESCENDING) | ||
+ | |- | ||
+ | ! Return | ||
+ | | Handle of new Queue entry or INVALID_HANDLE_VALUE if entry could not be created | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function QueueDestroy(Queue:TQueueHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Destroy and remove an existing Queue entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Queue | ||
+ | | Handle of Queue entry to destroy | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function QueueCount(Queue:TQueueHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current count from the supplied queue</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! List | ||
+ | | Handle of Queue entry to get from | ||
+ | |- | ||
+ | ! Return | ||
+ | | Queue count on success or INVALID_HANDLE_VALUE on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function QueueEnqueue(Queue:TQueueHandle; Thread:TThreadHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Add the supplied thread as the last item in the Queue</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Queue | ||
+ | | Handle of Queue entry to add to | ||
+ | |- | ||
+ | ! Thread | ||
+ | | Handle of the Thread to enqueue | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | If queue is a scheduler queue then caller must hold the lock on the thread | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function QueueDequeue(Queue:TQueueHandle):TThreadHandle;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get and remove the first thread from the Queue</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Queue | ||
+ | | Handle of Queue entry to get from | ||
+ | |- | ||
+ | ! Return | ||
+ | | Handle of dequeued Thread or INVALID_HANDLE_VALUE on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function QueueDequeueEx(Queue:TQueueHandle; Lock,Unlock:Boolean):TThreadHandle;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get and remove the first thread from the Queue</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Queue | ||
+ | | Handle of Queue entry to get from | ||
+ | |- | ||
+ | ! Lock | ||
+ | | Lock the Queue on entry if True | ||
+ | |- | ||
+ | ! Unlock | ||
+ | | Unlock the Queue on exit if True | ||
+ | |- | ||
+ | ! Return | ||
+ | | Handle of dequeued Thread or INVALID_HANDLE_VALUE on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | Extended version used internally by the scheduler | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function QueueFirstKey(Queue:TQueueHandle):Integer;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the first Key value from the Queue</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Queue | ||
+ | | Handle of Queue entry to get from | ||
+ | |- | ||
+ | ! Return | ||
+ | | First Key value from queue or QUEUE_KEY_NONE on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function QueueFirstKeyEx(Queue:TQueueHandle; Lock,Unlock:Boolean):Integer;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the first Key value from the Queue</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Queue | ||
+ | | Handle of Queue entry to get from | ||
+ | |- | ||
+ | ! Lock | ||
+ | | Lock the Queue on entry if True | ||
+ | |- | ||
+ | ! Unlock | ||
+ | | Unlock the Queue on exit if True | ||
+ | |- | ||
+ | ! Return | ||
+ | | First Key value from queue or QUEUE_KEY_NONE on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | Extended version used internally by the scheduler | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function QueueLastKey(Queue:TQueueHandle):Integer;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the last Key value from the Queue</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Queue | ||
+ | | Handle of Queue entry to get from | ||
+ | |- | ||
+ | ! Return | ||
+ | | Last Key value from queue or QUEUE_KEY_NONE on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function QueueLastKeyEx(Queue:TQueueHandle; Lock,Unlock:Boolean):Integer;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the last Key value from the Queue</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Queue | ||
+ | | Handle of Queue entry to get from | ||
+ | |- | ||
+ | ! Lock | ||
+ | | Lock the Queue on entry if True | ||
+ | |- | ||
+ | ! Unlock | ||
+ | | Unlock the Queue on exit if True | ||
+ | |- | ||
+ | ! Return | ||
+ | | Last Key value from queue or QUEUE_KEY_NONE on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | Extended version used internally by the scheduler | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function QueueInsertKey(Queue:TQueueHandle; Thread:TThreadHandle; Key:Integer):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Insert the supplied thread in the Queue ordered based on Key and the flags of the Queue</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Queue | ||
+ | | Handle of Queue entry to insert into | ||
+ | |- | ||
+ | ! Thread | ||
+ | | Handle of thread to be inserted | ||
+ | |- | ||
+ | ! Key | ||
+ | | The key to order the insertion on | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | If queue is a scheduler queue then caller must hold the lock on the thread} | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function QueueDeleteKey(Queue:TQueueHandle; Thread:TThreadHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Delete the supplied thread from the Queue based on the flags of the Queue</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Queue | ||
+ | | Handle of Queue entry to delete from | ||
+ | |- | ||
+ | ! Thread | ||
+ | | Handle of thread to be deleted | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | If queue is a scheduler queue then caller must hold the lock on the thread | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function QueueIncrementKey(Queue:TQueueHandle):Integer;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Increment the first Key value in the Queue</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Queue | ||
+ | | Handle of Queue entry to increment in | ||
+ | |- | ||
+ | ! Return | ||
+ | | First Key value in queue after increment or QUEUE_KEY_NONE on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function QueueDecrementKey(Queue:TQueueHandle):Integer;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Decrement the first Key value in the Queue</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Queue | ||
+ | | Handle of Queue entry to decrement in | ||
+ | |- | ||
+ | ! Return | ||
+ | | First Key value in queue after decrement or QUEUE_KEY_NONE on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function QueueIsEmpty(Queue:TQueueHandle):Boolean;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Check if the supplied Queue is empty</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Queue | ||
+ | | Handle of Queue entry to check | ||
+ | |- | ||
+ | ! Return | ||
+ | | True if Queue is empty or does not exist, False if Queue is not empty | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function QueueNotEmpty(Queue:TQueueHandle):Boolean;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Check if the supplied Queue is not empty</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Queue | ||
+ | | Handle of Queue entry to check | ||
+ | |- | ||
+ | ! Return | ||
+ | | True if Queue is not empty, False if Queue is empty or does not exist | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function QueueLock(Queue:TQueueHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Lock the supplied Queue</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Queue | ||
+ | | Handle of Queue entry to lock | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function QueueUnlock(Queue:TQueueHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Unlock the supplied Queue</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Queue | ||
+ | | Handle of Queue entry to unlock | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | |||
+ | '''Thread functions''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadCreate(StartProc:TThreadStart; StackSize,Priority:LongWord; Name:PChar; Parameter:Pointer):TThreadHandle;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create and insert a new Thread entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! StartProc | ||
+ | | Procedure address where the thread will start running | ||
+ | |- | ||
+ | ! StackSize | ||
+ | | Stack size in bytes | ||
+ | |- | ||
+ | ! Priority | ||
+ | | Thread priority (eg THREAD_PRIORITY_NORMAL) | ||
+ | |- | ||
+ | ! Name | ||
+ | | Name of the thread | ||
+ | |- | ||
+ | ! Parameter | ||
+ | | Parameter passed to StartProc of new thread | ||
+ | |- | ||
+ | ! Return | ||
+ | | Handle of new thread or INVALID_HANDLE_VALUE if a new thread could not be created | ||
+ | |- | ||
+ | ! Note | ||
+ | | The new thread will be created suspended so it will not start running until it is scheduled with either ThreadReady or ThreadResume. Calls ThreadCreateEx with: Affinity = SCHEDULER_CPU_MASK (Run on any available CPU) CPU = SchedulerThreadNext (Assign to next CPU in round robin). | ||
+ | |- | ||
+ | ! Warning | ||
+ | | ThreadCreate and ThreadCreateEx are only used internally by SysBeginThread and SysBeginThreadEx. These functions do not handle setting up certain RTL functionality such as thread variables, exceptions and standard input/output handles. If you need to create a standard thread use either BeginThread (or BeginThreadEx) or use the TThread class and its descendants. Only use ThreadCreate and ThreadCreateEx if you need to modify the thread creation behaviour and understand that you also need to handle the additional RTL setup. | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadCreateEx(StartProc:TThreadStart; StackSize,Priority,Affinity,CPU:LongWord; Name:PChar; Parameter:Pointer):TThreadHandle;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create and insert a new Thread entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! StartProc | ||
+ | | Procedure address where the thread will start running | ||
+ | |- | ||
+ | ! StackSize | ||
+ | | Stack size in bytes | ||
+ | |- | ||
+ | ! Priority | ||
+ | | Thread priority (eg THREAD_PRIORITY_NORMAL) | ||
+ | |- | ||
+ | ! Affinity | ||
+ | | Thread affinity (eg CPU_AFFINITY_ALL) | ||
+ | |- | ||
+ | ! CPU | ||
+ | | The CPU to assign new thread to | ||
+ | |- | ||
+ | ! Name | ||
+ | | Name of the thread | ||
+ | |- | ||
+ | ! Parameter | ||
+ | | Parameter passed to StartProc of new thread | ||
+ | |- | ||
+ | ! Return | ||
+ | | Handle of new thread or INVALID_HANDLE_VALUE if a new thread could not be created | ||
+ | |- | ||
+ | ! Note | ||
+ | | The new thread will be created suspended so it will not start running until it is scheduled with either ThreadReady or ThreadResume. | ||
+ | |- | ||
+ | ! Warning | ||
+ | | ThreadCreate and ThreadCreateEx are only used internally by SysBeginThread and SysBeginThreadEx. These functions do not handle setting up certain RTL functionality such as thread variables, exceptions and standard input/output handles. If you need to create a standard thread use either BeginThread (or BeginThreadEx) or use the TThread class or its descendants. Only use ThreadCreate and ThreadCreateEx if you need to modify the thread creation behaviour and understand that you also need to handle the additional RTL setup | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadDestroy(Thread:TThreadHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Destroy and remove an existing Thread entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Thread | ||
+ | | Handle of thread to destroy | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadGetCurrent:TThreadHandle; inline;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the Handle of currently executing thread</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Return | ||
+ | | Thread handle of the currently running thread | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadSetCurrent(Thread:TThreadHandle):LongWord; inline;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the Handle of currently executing thread</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | Must not be called except during initialization | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadGetName(Thread:TThreadHandle):String;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the name of a Thread}</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Thread | ||
+ | | Handle of thread to get | ||
+ | |- | ||
+ | ! Return | ||
+ | | Name of thread or empty string on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadSetName(Thread:TThreadHandle; const Name:String):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the name of a Thread</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Thread | ||
+ | | Handle of thread to set | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadGetCPU(Thread:TThreadHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current CPU of a thread (eg CPU_ID_0)</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Thread | ||
+ | | Handle of thread to get | ||
+ | |- | ||
+ | ! Return | ||
+ | | CPU of the thread or INVALID_HANDLE_VALUE on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadSetCPU(Thread:TThreadHandle; CPU:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the current CPU of a thread (eg CPU_ID_0)</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Thread | ||
+ | | Handle of thread to set | ||
+ | |- | ||
+ | ! CPU | ||
+ | | New thread CPU (eg CPU_ID_0) | ||
+ | |- | ||
+ | ! Return | ||
+ | | Previous CPU of thread or INVALID_HANDLE_VALUE on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | The new CPU will not take affect until the thread is next rescheduled | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadGetState(Thread:TThreadHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current state of a thread (eg THREAD_STATE_SUSPENDED)</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Thread | ||
+ | | Handle of thread to get | ||
+ | |- | ||
+ | ! Return | ||
+ | | State of the thread or INVALID_HANDLE_VALUE on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadGetFlags(Thread:TThreadHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current flags of a thread</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Thread | ||
+ | | Handle of thread to get | ||
+ | |- | ||
+ | ! Return | ||
+ | | Flags of the thread (eg THREAD_FLAG_PERSIST) or INVALID_HANDLE_VALUE on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadSetFlags(Thread:TThreadHandle; Flags:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the current flags of a thread</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Thread | ||
+ | | Handle of thread to set | ||
+ | |- | ||
+ | ! Flags | ||
+ | | Flags to set (eg THREAD_FLAG_PERSIST) | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadAddFlags(Thread:TThreadHandle; Flags:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Add flags to the current flags of a thread</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Thread | ||
+ | | Handle of thread to add flags for | ||
+ | |- | ||
+ | ! Flags | ||
+ | | Flags to add (eg THREAD_FLAG_PERSIST) | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadRemoveFlags(Thread:TThreadHandle; Flags:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Remove flags from the current flags of a thread</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Thread | ||
+ | | Handle of thread to remove flags from | ||
+ | |- | ||
+ | ! Flags | ||
+ | | Flags to remove (eg THREAD_FLAG_PERSIST) | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadGetLocale(Thread:TThreadHandle):LCID;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current locale of a thread</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Thread | ||
+ | | Handle of thread to get | ||
+ | |- | ||
+ | ! Return | ||
+ | | Locale of the thread or INVALID_HANDLE_VALUE on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadSetLocale(Thread:TThreadHandle; Locale:LCID):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the locale of a thread</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Thread | ||
+ | | Handle of thread to set | ||
+ | |- | ||
+ | ! Locale | ||
+ | | Locale Id to set | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadGetTimes(Thread:TThreadHandle; var CreateTime,ExitTime,KernelTime:Int64):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current times of a thread</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Thread | ||
+ | | Handle of thread to get | ||
+ | |- | ||
+ | ! CreateTime | ||
+ | | Buffer to receive the CreateTime value | ||
+ | |- | ||
+ | ! ExitTime | ||
+ | | Buffer to receive the ExitTime value | ||
+ | |- | ||
+ | ! KernelTime | ||
+ | | Buffer to receive the KernelTime value | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadGetSwitchCount(Thread:TThreadHandle; var SwitchCount:Int64):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current context switch count of a thread (How many times the thread has been scheduled)</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Thread | ||
+ | | Handle of thread to get | ||
+ | |- | ||
+ | ! SwitchCount | ||
+ | | Buffer to receive the SwitchCount value | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadGetStackFree:LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the free stack size of the current thread</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Return | ||
+ | | Free stack size of the current thread or 0 on error | ||
+ | |- | ||
+ | ! Note | ||
+ | | No lock required as only ever called by the thread itself | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadGetStackSize(Thread:TThreadHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current stack size of a thread</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Thread | ||
+ | | Handle of thread to get | ||
+ | |- | ||
+ | ! Return | ||
+ | | Stack size of the thread or INVALID_HANDLE_VALUE on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadGetStackBase(Thread:TThreadHandle):PtrUInt;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current stack base of a thread</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Thread | ||
+ | | Handle of thread to get | ||
+ | |- | ||
+ | ! Return | ||
+ | | Stack base of the thread or INVALID_HANDLE_VALUE on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadSetStackBase(Thread:TThreadHandle; StackBase:PtrUInt):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the current stack base of a thread</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Thread | ||
+ | | Handle of thread to set | ||
+ | |- | ||
+ | ! StackBase | ||
+ | | Stack base to set | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | Must not be called except during initialization | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadGetStackPointer(Thread:TThreadHandle):PtrUInt;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current stack pointer of a thread</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Thread | ||
+ | | Handle of thread to get | ||
+ | |- | ||
+ | ! Return | ||
+ | | Stack pointer of the thread or INVALID_HANDLE_VALUE on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadGetExitCode(Thread:TThreadHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the exit code of a Thread</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Thread | ||
+ | | Handle of thread to get | ||
+ | |- | ||
+ | ! Return | ||
+ | | Exit code of thread, STILL_ACTIVE if the thread has not terminated or INVALID_HANDLE_VALUE on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadGetAffinity(Thread:TThreadHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the scheduling affinity of a Thread</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Thread | ||
+ | | Handle of thread to get | ||
+ | |- | ||
+ | ! Return | ||
+ | | Affinity of thread or INVALID_HANDLE_VALUE on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadSetAffinity(Thread:TThreadHandle; Affinity:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the scheduling affinity of a Thread</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Thread | ||
+ | | Handle of thread to set | ||
+ | |- | ||
+ | ! Affinity | ||
+ | | New thread affinity (eg CPU_AFFINITY_0) | ||
+ | |- | ||
+ | ! Return | ||
+ | | Previous affinity of thread or INVALID_HANDLE_VALUE on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | The new affinity will not take affect until the thread is next rescheduled | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadGetPriority(Thread:TThreadHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the scheduling priority of a Thread</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Thread | ||
+ | | Handle of thread to get | ||
+ | |- | ||
+ | ! Return | ||
+ | | Priority of thread or INVALID_HANDLE_VALUE on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadSetPriority(Thread:TThreadHandle; Priority:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the scheduling priority of a Thread</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Thread | ||
+ | | Handle of thread to set | ||
+ | |- | ||
+ | ! Priority | ||
+ | | New thread priority (eg THREAD_PRIORITY_NORMAL) | ||
+ | |- | ||
+ | ! Return | ||
+ | | Previous priority of thread or INVALID_HANDLE_VALUE on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | The new priority will not take affect until the thread is next rescheduled | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadGetLastError:LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the last error value for the current Thread</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Return | ||
+ | | Last Error of thread or ERROR_SUCCESS if no error | ||
+ | |- | ||
+ | ! Note | ||
+ | | No lock required as only ever called by the thread itself | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure ThreadSetLastError(LastError:LongWord);</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the last error value for the current Thread</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | No lock required as only ever called by the thread itself | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadSetLastErrorEx(LastError:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the last error value for the current Thread</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | No lock required as only ever called by the thread itself | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadGetWaitResult:LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the result of the last wait timeout for the current Thread</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Return | ||
+ | | Result of last wait timeout or ERROR_SUCCESS if no error | ||
+ | |- | ||
+ | ! Note | ||
+ | | No lock required as only ever called by the thread itself | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadGetReceiveResult:LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the result of the last receive timeout for the current Thread</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Return | ||
+ | | Result of last receive timeout or ERROR_SUCCESS if no error | ||
+ | |- | ||
+ | ! Note | ||
+ | | No lock required as only ever called by the thread itself | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadGetTlsIndex(TlsIndex:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current status of a TLS index in the TLS index table</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! TlsIndex | ||
+ | | The TLS index to get the status for | ||
+ | |- | ||
+ | ! Return | ||
+ | | THREAD_TLS_FREE if unused, THREAD_TLS_USED if in use or THREAD_TLS_INVALID on error | ||
+ | |- | ||
+ | ! Note | ||
+ | | No lock required as only ever reads from the table | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadAllocTlsIndex:LongWord; inline;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Allocate a TLS index in the TLS index table</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Return | ||
+ | | Allocated TLS index or TLS_OUT_OF_INDEXES on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadAllocTlsIndexEx(Flags:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Allocate a TLS index in the TLS index table</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Flags | ||
+ | | The flags to apply to the TLS index entries (eg THREAD_TLS_FLAG_FREE) | ||
+ | |- | ||
+ | ! Return | ||
+ | | Allocated TLS index or TLS_OUT_OF_INDEXES on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadReleaseTlsIndex(TlsIndex:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Deallocate a TLS index from the TLS index table</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! TlsIndex | ||
+ | | The TLS index to deallocate | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadGetTlsValue(TlsIndex:LongWord):Pointer;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the pointer associated with the TLS index for the current thread</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Return | ||
+ | | Pointer for the specified TLS index or nil if not set or on error | ||
+ | |- | ||
+ | ! Note | ||
+ | | No lock required as only ever called by the thread itself | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadSetTlsValue(TlsIndex:LongWord; TlsValue:Pointer):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the pointer associated with the TLS index for the current thread</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! TlsIndex | ||
+ | | The TLS index to get the pointer for | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | No lock required as only ever called by the thread itself | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadGetTlsPointer(Thread:TThreadHandle):Pointer;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the RTL TLS (Thread Local Storage) pointer of a Thread</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Thread | ||
+ | | Handle of thread to get | ||
+ | |- | ||
+ | ! Return | ||
+ | | Pointer to the RTL TLS of thread or nil on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadSetTlsPointer(Thread:TThreadHandle; TlsPointer:Pointer):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the RTL TLS (Thread Local Storage) pointer of a Thread</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Thread | ||
+ | | Handle of thread to set | ||
+ | |- | ||
+ | ! TlsPointer | ||
+ | | Pointer value to set (Can be nil to clear the pointer) | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadReady(Thread:TThreadHandle; Reschedule:Boolean):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Place the supplied Thread on the ready queue</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Thread | ||
+ | | Handle of thread to make ready | ||
+ | |- | ||
+ | ! Reschedule | ||
+ | | If True then call SchedulerReschedule | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | When called by the scheduler, thread has already been removed from the sleep queue | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadTimeout(Thread:TThreadHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Place the supplied Thread on the ready queue after a timeout waiting on a resource</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Thread | ||
+ | | Handle of thread to make ready | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | When called by the scheduler, thread has already been removed from the timeout queue | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadWake(Thread:TThreadHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Remove a thread prematurely from the sleep or timeout queues</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Thread | ||
+ | | Handle of thread to remove | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | A thread that was sleeping will simply return early. A thread that was waiting or receiving with a timeout will return with the error WAIT_TIMEOUT. A thread that was waiting or receiving with INFINITE timeout will return with the error WAIT_ABANDONED. | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadMigrate(Thread:TThreadHandle; CPU:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Migrate a thread to a new CPU</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Thread | ||
+ | | Handle of thread to migrate | ||
+ | |- | ||
+ | ! CPU | ||
+ | | New CPU for the thread | ||
+ | |- | ||
+ | ! Return | ||
+ | | Previous CPU of thread or INVALID_HANDLE_VALUE on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure ThreadEnd(ExitCode:LongWord);</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Terminate the current Thread</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! ExitCode | ||
+ | | The return code of the thread | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadHalt(ExitCode:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Halt the current thread so it will never be rescheduled</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! ExitCode | ||
+ | | The return code of the thread | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | Normally only called due to an unhandled exception etc so that the thread is put to sleep permanently without being terminated | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadTerminate(Thread:TThreadHandle; ExitCode:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Terminate but do not destroy the supplied Thread</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Thread | ||
+ | | Handle of thread to terminate | ||
+ | |- | ||
+ | ! ExitCode | ||
+ | | The return code of the thread | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | The terminated thread is placed on the termination queue until any threads waiting on it have been released | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadYield:LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Make the current thread yield the processor (Same as ThreadSleep(0))</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadSleep(Milliseconds:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Place the current thread on the sleep queue for a specified number of milliseconds</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Milliseconds | ||
+ | | Number of milliseconds to sleep | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadWait(List:TListHandle; Lock:TSpinHandle; Flags:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Put the current thread into a wait state on the supplied list</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! List | ||
+ | | Handle of List entry to put thread into | ||
+ | |- | ||
+ | ! Lock | ||
+ | | Handle of Lock to release before going into wait state | ||
+ | |- | ||
+ | ! Flags | ||
+ | | Flag to indicate which unlock method to use | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | Caller must hold the lock on the synchronisation object containing the list | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadWaitEx(List:TListHandle; Lock:TSpinHandle; Flags,Timeout:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Put the current thread into a wait state with timeout on the supplied list</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! List | ||
+ | | Handle of List entry to put thread into | ||
+ | |- | ||
+ | ! Lock | ||
+ | | Handle of Lock to release before going into wait state | ||
+ | |- | ||
+ | ! Flags | ||
+ | | Flag to indicate which unlock method to use | ||
+ | |- | ||
+ | ! Timeout | ||
+ | | Milliseconds to wait before timeout (INFINITE equals wait forever) | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | Caller must hold the lock on the synchronisation object containing the list | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadRelease(List:TListHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Release the first thread waiting on the supplied list</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! List | ||
+ | | Handle of List entry to release thread from | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | Caller must hold the lock on the synchronisation object containing the list | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadAbandon(List:TListHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Release the first thread waiting on the supplied list and return with WAIT_ABANDONED</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! List | ||
+ | | Handle of List entry to release thread from | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | Caller must hold the lock on the synchronisation object containing the list | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadWaitTerminate(Thread:TThreadHandle; Timeout:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Make the current thread wait until the specified thread has terminated</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Thread | ||
+ | | Handle of the thread to wait on | ||
+ | |- | ||
+ | ! Timeout | ||
+ | | Milliseconds to wait before timeout (0 equals do not wait, INFINITE equals wait forever) | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | The wait can be abandoned by calling ThreadWake with the handle of the waiting thread | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadSuspend(Thread:TThreadHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Suspend a thread, placing it in hibernation</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Thread | ||
+ | | Handle of thread to suspend | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | Suspending a thread from another thread is not safe unless specific precautions are taken to prevent deadlocks. It is normally safe for a thread to suspend itself as long as it releases any locks it is holding that may be required by other threads before suspending. | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadResume(Thread:TThreadHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Resume a suspended thread, making it ready</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Thread | ||
+ | | Handle of thread to resume | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadWaitMessage:LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Make the current thread wait until a message is received (indefinitely)</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | The received message is not removed from the message list | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadSendMessage(Thread:TThreadHandle; const Message:TMessage):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Send a message to another thread</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Thread | ||
+ | | Handle of thread to send to | ||
+ | |- | ||
+ | ! Message | ||
+ | | Contents of message to send | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadReceiveMessage(var Message:TMessage):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Make the current thread wait to receive a message (indefinitely)</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Message | ||
+ | | The received message if successful, undefined on error | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadReceiveMessageEx(var Message:TMessage; Timeout:LongWord; Remove:Boolean):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Make the current thread wait to receive a message</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Message | ||
+ | | The received message if successful, undefined on error | ||
+ | |- | ||
+ | ! Timeout | ||
+ | | Milliseconds to wait before timeout (0 equals do not wait, INFINITE equals wait forever) | ||
+ | |- | ||
+ | ! Remove | ||
+ | | If true then remove the received message from the message list | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadAbandonMessage(Thread:TThreadHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Tell another thread to abandon waiting for a message</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Thread | ||
+ | | Handle of thread to abandon waiting | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | The waiting thread will return with ERROR_WAIT_ABANDONED or ERROR_WAIT_TIMEOUT | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadLock(Thread:TThreadHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Lock a thread allowing access to internal structures such as the thread stack</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Thread | ||
+ | | Handle of thread to lock | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | Locking a thread will also disable IRQ or FIQ depending on scheduler settings. The lock should only be held for the briefest time possible. | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadUnlock(Thread:TThreadHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Unlock a thread that was locked by ThreadLock</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Thread | ||
+ | | Handle of thread to unlock | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | Locking a thread will also disable IRQ or FIQ depending on scheduler settings. The lock should only be held for the briefest time possible. | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure ThreadTimer(Data:Pointer);</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Procedure called internally to process terminated threads</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | Not intended to be called directly by applications | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | |||
+ | '''Scheduler functions''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SchedulerCheck(CPUID:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Check if the sleep queue is empty, if not then decrement the first key. Note: Then check if the timeout queue is empty, if not then decrement the first key. If either key reaches zero, return success to indicate there are threads to be woken or threads whose timeout has expired. Finally check if the termination queue is empty, if not then decrement the first key. Items will be removed from the termination queue by SchedulerReschedule.</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! CPUID | ||
+ | | The ID of the current CPU | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if either first key is zero, ERROR_NO_MORE_ITEMS if both queues are empty or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | Called by scheduler interrupt with IRQ or FIQ disabled and running on the IRQ or FIQ thread | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SchedulerWakeup(CPUID:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Remove all threads from the sleep queue that have no more time to sleep. Note: Threads will be placed back on the ready queue for rescheduling.</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! CPUID | ||
+ | | The ID of the current CPU | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | Called by scheduler interrupt with IRQ or FIQ disabled and running on the IRQ or FIQ thread | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SchedulerExpire(CPUID:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Remove all threads from the timeout queue that have no more time to wait. Note: Threads will be placed back on the ready queue for rescheduling but will return with an error indicating the timeout expired.</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! CPUID | ||
+ | | The ID of the current CPU | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | Called by scheduler interrupt with IRQ or FIQ disabled and running on the IRQ or FIQ thread | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SchedulerSwitch(CPUID:LongWord; Thread:TThreadHandle):TThreadHandle;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Perform a preemptive thread switch operation under an interrupt handler. Note: The next thread to run will be selected based on remaining quantum of the current thread, ready threads at higher priority levels and scheduler priority quantum for fair scheduling of lower priority threads.</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! CPUID | ||
+ | | The ID of the current CPU | ||
+ | |- | ||
+ | ! Thread | ||
+ | | The handle of the currently running thread (Before IRQ or FIQ occurred) | ||
+ | |- | ||
+ | ! Return | ||
+ | | The handle of the current thread which may be the old thread or a new thread | ||
+ | |- | ||
+ | ! Note | ||
+ | | Called by scheduler interrupt with IRQ or FIQ disabled and running on the IRQ or FIQ thread | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SchedulerSelect(CPUID:LongWord; Thread:TThreadHandle; Yield:Boolean):TThreadHandle;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Select the next thread to be run based on state, yield, quantum and priority</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! CPUID | ||
+ | | The ID of the current CPU | ||
+ | |- | ||
+ | ! Thread | ||
+ | | The handle of the currently running thread (Before IRQ or FIQ occurred or when Reschedule was called) | ||
+ | |- | ||
+ | ! Yield | ||
+ | | True if the current thread is giving up its remaining time slice | ||
+ | |- | ||
+ | ! Return | ||
+ | | The handle of the next thread to run or INVALID_HANDLE_VALUE on no selection or error | ||
+ | |- | ||
+ | ! Note | ||
+ | | Called either by scheduler interrupt with IRQ or FIQ disabled and running on the IRQ or FIQ thread. Or by scheduler reschedule with IRQ or FIQ disabled and running on the current thread. Caller must either hold a lock on the current thread or have disabled IRQ or FIQ. | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SchedulerReschedule(Yield:Boolean):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Perform a thread switch operation when a thread yields, sleeps or waits. Note: The next thread to run will be selected based on whether the current thread is yielding or no longer ready, remaining quantum of the current thread, ready threads at higher priority levels and scheduler priority quantum for fair scheduling of lower priority threads.</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Yield | ||
+ | | True if the current thread is giving up its remaining time slice | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | Called by the currently running thread to force a reschedule before sleeping, waiting etc | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SchedulerMigrationEnable:LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Enable scheduler thread migration</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SchedulerMigrationDisable:LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Disable scheduler thread migration</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SchedulerPreemptEnable(CPUID:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Enable thread preemption for the specified CPU</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! CPUID | ||
+ | | The ID of the CPU to enable for | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SchedulerPreemptDisable(CPUID:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Disable thread preemption for the specified CPU</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! CPUID | ||
+ | | The ID of the CPU to disable for | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SchedulerAllocationEnable(CPUID:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Enable thread allocation for the specified CPU</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! CPUID | ||
+ | | The ID of the CPU to enable for | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SchedulerAllocationDisable(CPUID:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Disable thread allocation for the specified CPU</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! CPUID | ||
+ | | The ID of the CPU to disable for | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | |||
+ | '''Messageslot functions''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function MessageslotCreate:TMessageslotHandle;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create and insert a new Messageslot entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Return | ||
+ | | Handle of new Messageslot entry or INVALID_HANDLE_VALUE if entry could not be created | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function MessageslotCreateEx(Maximum:LongWord; Flags:LongWord):TMessageslotHandle;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create and insert a new Messageslot entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Maximum | ||
+ | | Maximum number of messages allowed for the Messageslot (Must be greater than zero) | ||
+ | |- | ||
+ | ! Flags | ||
+ | | The flags for the Messageslot entry (eg MESSAGESLOT_FLAG_IRQ) | ||
+ | |- | ||
+ | ! Return | ||
+ | | Handle of new Messageslot entry or INVALID_HANDLE_VALUE if entry could not be created | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function MessageslotDestroy(Messageslot:TMessageslotHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Destroy and remove an existing Messageslot entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Messageslot | ||
+ | | Handle of Messageslot entry to destroy | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function MessageslotCount(Messageslot:TMessageslotHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the number of available messages in a Messageslot entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Messageslot | ||
+ | | Messageslot to get from | ||
+ | |- | ||
+ | ! Return | ||
+ | | Number of messages or INVALID_HANDLE_VALUE on error | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function MessageslotSend(Messageslot:TMessageslotHandle; const Message:TMessage):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Send a message to a Messageslot</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Messageslot | ||
+ | | Messageslot to send to | ||
+ | |- | ||
+ | ! Message | ||
+ | | Contents of message to send | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function MessageslotReceive(Messageslot:TMessageslotHandle; var Message:TMessage):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Receive a message from a Messageslot</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Messageslot | ||
+ | | Messageslot to receive from | ||
+ | |- | ||
+ | ! Message | ||
+ | | The received message if successful, undefined on error | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function MessageslotReceiveEx(Messageslot:TMessageslotHandle; var Message:TMessage; Timeout:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Receive a message from a Messageslot</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Messageslot | ||
+ | | Messageslot to receive from | ||
+ | |- | ||
+ | ! Message | ||
+ | | The received message if successful, undefined on error | ||
+ | |- | ||
+ | ! Timeout | ||
+ | | Milliseconds to wait before timeout (0 equals do not wait, INFINITE equals wait forever) | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | |||
+ | '''Mailslot functions''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function MailslotCreate(Maximum:LongWord):TMailslotHandle;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create and insert a new Mailslot entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Maximum | ||
+ | | Maximum number of messages allowed for the Mailslot (Must be greater than zero) | ||
+ | |- | ||
+ | ! Return | ||
+ | | Handle of new Mailslot entry or INVALID_HANDLE_VALUE if entry could not be created | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function MailslotDestroy(Mailslot:TMailslotHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Destroy and remove an existing Mailslot entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Mailslot | ||
+ | | Handle of Mailslot entry to destroy | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function MailslotCount(Mailslot:TMailslotHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the number of available messages in a Mailslot entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Mailslot | ||
+ | | Mailslot to get from | ||
+ | |- | ||
+ | ! Return | ||
+ | | Number of messages or INVALID_HANDLE_VALUE on error | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function MailslotSend(Mailslot:TMailslotHandle; Data:PtrInt):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Send a message to a Mailslot</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Mailslot | ||
+ | | Mailslot to send to | ||
+ | |- | ||
+ | ! Data | ||
+ | | Message to send to mailslot | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function MailslotSendEx(Mailslot:TMailslotHandle; Data:PtrInt; Timeout:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Send a message to a Mailslot</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Mailslot | ||
+ | | Mailslot to send to | ||
+ | |- | ||
+ | ! Data | ||
+ | | Message to send to mailslot | ||
+ | |- | ||
+ | ! Timeout | ||
+ | | Milliseconds to wait before timeout (0 equals do not wait, INFINITE equals wait forever) | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function MailslotReceive(Mailslot:TMailslotHandle):PtrInt;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Receive a message from a Mailslot</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Mailslot | ||
+ | | Mailslot to receive from | ||
+ | |- | ||
+ | ! Return | ||
+ | | Received message or INVALID_HANDLE_VALUE on error | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function MailslotReceiveEx(Mailslot:TMailslotHandle; Timeout:LongWord):PtrInt;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Receive a message from a Mailslot</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Timeout | ||
+ | | Timeout = 0 then No Wait, Timeout = INFINITE then Wait forever | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | |||
+ | '''Buffer functions''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function BufferCreate(Size,Count:LongWord):TBufferHandle;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create and insert a new Buffer entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Size | ||
+ | | Size of each buffer in bytes | ||
+ | |- | ||
+ | ! Count | ||
+ | | Total number of buffers | ||
+ | |- | ||
+ | ! Return | ||
+ | | Handle of new Buffer entry or INVALID_HANDLE_VALUE if entry could not be created | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function BufferCreateEx(Size,Count,Flags:LongWord):TBufferHandle;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create and insert a new Buffer entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Size | ||
+ | | Size of each buffer in bytes | ||
+ | |- | ||
+ | ! Count | ||
+ | | Total number of buffers | ||
+ | |- | ||
+ | ! Flags | ||
+ | | Flags for buffer (eg BUFFER_FLAG_SHARED) | ||
+ | |- | ||
+ | ! Return | ||
+ | | Handle of new Buffer entry or INVALID_HANDLE_VALUE if entry could not be created | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function BufferDestroy(Buffer:TBufferHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Destroy and remove an existing Buffer entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Buffer | ||
+ | | Handle of Buffer entry to destroy | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function BufferCount(Buffer:TBufferHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the total count of buffers in an existing Buffer entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Buffer | ||
+ | | Buffer to get total count for | ||
+ | |- | ||
+ | ! Return | ||
+ | | Total count or INVALID_HANDLE_VALUE on error | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function BufferAvailable(Buffer:TBufferHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the available count of buffers in an existing Buffer entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Buffer | ||
+ | | Buffer to get available count for | ||
+ | |- | ||
+ | ! Return | ||
+ | | Available count or INVALID_HANDLE_VALUE on error | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function BufferGet(Buffer:TBufferHandle):Pointer;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Allocate an available buffer from an existing Buffer entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Buffer | ||
+ | | Handle of Buffer entry to allocate from | ||
+ | |- | ||
+ | ! Return | ||
+ | | A pointer to the allocated buffer or nil on error | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function BufferGetEx(Buffer:TBufferHandle; Timeout:LongWord):Pointer;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Allocate an available buffer from an existing Buffer entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Buffer | ||
+ | | Handle of Buffer entry to allocate from | ||
+ | |- | ||
+ | ! Timeout | ||
+ | | Milliseconds to wait before timeout (0 equals do not wait, INFINITE equals wait forever) | ||
+ | |- | ||
+ | ! Return | ||
+ | | A pointer to the allocated buffer or nil on error | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function BufferFree(Buffer:Pointer):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Release a allocated buffer from an existing Buffer entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Buffer | ||
+ | | Pointer to the allocated buffer (As returned by BufferGet/BufferGetEx) | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function BufferIterate(Buffer:TBufferHandle; Previous:Pointer):Pointer;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Iterate through each of the buffers in an existing Buffer entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Buffer | ||
+ | | Handle of Buffer entry to iterate from | ||
+ | |- | ||
+ | ! Previous | ||
+ | | The pointer returned by the previous call or nil on first call | ||
+ | |- | ||
+ | ! Return | ||
+ | | A pointer to the next buffer or nil on error | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | |||
+ | '''Event functions''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function EventCreate(ManualReset,InitialState:Boolean):TEventHandle;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create and insert a new Event entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! ManualReset | ||
+ | | Create a manual reset event if true or an auto reset event if false. A manual reset event must be reset by calling EventReset. An auto reset event is reset when a single waiting thread is released. | ||
+ | |- | ||
+ | ! InitialState | ||
+ | | Set the initial state of the event to signaled if true or to unsignaled if false | ||
+ | |- | ||
+ | ! Return | ||
+ | | Handle of new Event entry or INVALID_HANDLE_VALUE if entry could not be created | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function EventCreateEx(Flags:LongWord):TEventHandle;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create and insert a new Event entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Flags | ||
+ | | Event flags to use for the new entry (eg EVENT_FLAG_MANUAL_RESET) | ||
+ | |- | ||
+ | ! Return | ||
+ | | Handle of new Event entry or INVALID_HANDLE_VALUE if entry could not be created | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function EventDestroy(Event:TEventHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Destroy and remove an existing Event entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Event | ||
+ | | Handle of Event entry to destroy | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function EventState(Event:TEventHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current state of an existing Event entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Event | ||
+ | | Event to get state for | ||
+ | |- | ||
+ | ! Return | ||
+ | | Current state or INVALID_HANDLE_VALUE on error | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function EventWait(Event:TEventHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Wait on an existing Event entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Event | ||
+ | | Event to wait on | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | If the Event is currently signaled then simply return immediately. If the Event is currently unsignaled then wait for it to be signaled before returning. | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function EventWaitEx(Event:TEventHandle; Timeout:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Wait on an existing Event entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Event | ||
+ | | Event to wait on | ||
+ | |- | ||
+ | ! Timeout | ||
+ | | Time in milliseconds to wait for the event to be signaled | ||
+ | 0 = No Wait | ||
+ | <br />INFINITE = Wait Indefinitely | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | If the Event is currently signaled then simply return immediately. If the Event is currently unsignaled then wait for it to be signaled before returning. | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function EventSet(Event:TEventHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set (Signal) an existing Event entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Event | ||
+ | | Event to set | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | If the event is currently signaled then return with no action. If the event is unsignaled then, if the event is manual reset release all waiting threads and return. If the event is auto reset release one waiting thread, unsignal the event and return. If no threads are waiting then simply signal the event and return, if the event is auto reset then the next thread to wait will unsignal the event. | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function EventReset(Event:TEventHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Reset (Unsignal) an existing Event entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Event | ||
+ | | Event to reset | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | If the event is currently unsignaled then return with no action. If the event is signaled then unsignal the event and return. | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function EventPulse(Event:TEventHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Pulse (Set then Reset) an existing Event entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Event | ||
+ | | Event to pulse | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | If the event is currently signaled then unsignal the event and return. If the event is unsignaled then, if the event is manual reset release all waiting threads, unsignal the event and return. If the event is auto reset release one waiting thread, unsignal the event and return. If no threads are waiting then simply unsignal the event and return. | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | |||
+ | '''Timer functions''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TimerCreate(Interval:LongWord; Enabled,Reschedule:Boolean; Event:TTimerEvent; Data:Pointer):TTimerHandle;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create and insert a new Timer entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Interval | ||
+ | | Number of milliseconds between timer events | ||
+ | |- | ||
+ | ! Enabled | ||
+ | | If true then timer generates events | ||
+ | |- | ||
+ | ! Reschedule | ||
+ | | If true then reschedule timer after each event | ||
+ | |- | ||
+ | ! Event | ||
+ | | The function to call when the timer event is generated | ||
+ | |- | ||
+ | ! Data | ||
+ | | Data to be passed to the function when the timer event is generated (May be nil) | ||
+ | |- | ||
+ | ! Return | ||
+ | | Handle of new Timer entry or INVALID_HANDLE_VALUE if entry could not be created | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TimerCreateEx(Interval,State,Flags:LongWord; Event:TTimerEvent; Data:Pointer):TTimerHandle;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create and insert a new Timer entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Interval | ||
+ | | Number of milliseconds between timer events | ||
+ | |- | ||
+ | ! State | ||
+ | | State of timer entry (eg TIMER_STATE_ENABLED) | ||
+ | |- | ||
+ | ! Flags | ||
+ | | Flags of timer entry (eg TIMER_FLAG_RESCHEDULE) | ||
+ | |- | ||
+ | ! Event | ||
+ | | The function to call when the timer event is generated | ||
+ | |- | ||
+ | ! Data | ||
+ | | Data to be passed to the function when the timer event is generated (May be nil) | ||
+ | |- | ||
+ | ! Return | ||
+ | | Handle of new Timer entry or INVALID_HANDLE_VALUE if entry could not be created | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TimerDestroy(Timer:TTimerHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Destroy and remove an existing Timer entry</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Timer | ||
+ | | Handle of Timer entry to destroy | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TimerEnable(Timer:TTimerHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Enable an existing Timer entry (Timer events will be generated)</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Timer | ||
+ | | Handle of Timer entry to enable | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TimerEnableEx(Timer:TTimerHandle; Interval:LongWord; Event:TTimerEvent; Data:Pointer):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Enable and update an existing Timer entry (Timer events will be generated)</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Timer | ||
+ | | Handle of Timer entry to enable | ||
+ | |- | ||
+ | ! Interval | ||
+ | | Number of milliseconds between timer events | ||
+ | |- | ||
+ | ! Event | ||
+ | | The function to call when the timer event is generated | ||
+ | |- | ||
+ | ! Data | ||
+ | | Data to be passed to the function when the timer event is generated (May be nil) | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TimerDisable(Timer:TTimerHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Disable an existing Timer entry (Timer events will not be generated)</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Timer | ||
+ | | Handle of Timer entry to disable | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TimerDequeue:TTimerHandle;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TimerFirstKey:Integer;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TimerInsertKey(Timer:TTimerHandle; Key:Integer):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TimerDeleteKey(Timer:TTimerHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TimerDecrementKey:Integer;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TimerIsEmpty:Boolean;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TimerNotEmpty:Boolean;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TimerCheck:LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TimerTrigger:LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | |||
+ | '''Worker functions''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function WorkerSchedule(Interval:LongWord; Task:TWorkerTask; Data:Pointer; Callback:TWorkerCallback):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function WorkerScheduleEx(Interval,Flags:LongWord; Task:TWorkerTask; Data:Pointer; Callback:TWorkerCallback):TWorkerHandle;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function WorkerCancel(Worker:TWorkerHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function WorkerScheduleIRQ(Affinity:LongWord; Task:TWorkerTask; Data:Pointer; Callback:TWorkerCallback):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function WorkerScheduleIRQEx(Affinity,Flags:LongWord; Task:TWorkerTask; Data:Pointer; Callback:TWorkerCallback):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function WorkerScheduleFIQ(Affinity:LongWord; Task:TWorkerTask; Data:Pointer; Callback:TWorkerCallback):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function WorkerScheduleFIQEx(Affinity,Flags:LongWord; Task:TWorkerTask; Data:Pointer; Callback:TWorkerCallback):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function WorkerIncrease(Count:LongWord):LongWord; inline;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function WorkerIncreaseEx(Count:LongWord; Priority:Boolean):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function WorkerDecrease(Count:LongWord):LongWord; inline;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function WorkerDecreaseEx(Count:LongWord; Priority:Boolean):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure WorkerTimer(WorkerRequest:PWorkerRequest);</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Procedure called internally to schedule worker threads</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | Not intended to be called directly by applications | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | |||
+ | '''Tasker functions''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TaskerThreadSendMessage(Thread:TThreadHandle; const Message:TMessage):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Perform a ThreadSendMessage() function call using the tasker list</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TaskerMessageslotSend(Messageslot:TMessageslotHandle; const Message:TMessage):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Perform a MessageslotSend() function call using the tasker list</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TaskerSemaphoreSignal(Semaphore:TSemaphoreHandle; Count:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Perform a SemaphoreSignal() function call using the tasker list</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TaskerCompletionReset(Completion:TCompletionHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Perform a CompletionReset() function call using the tasker list</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TaskerCompletionComplete(Completion:TCompletionHandle; All:Boolean):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Perform a CompletionComplete() or CompletionCompleteAll() function call using the tasker list</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TaskerEnqueue(Task:PTaskerTask):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Add the supplied task to the end of the Tasker list</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TaskerDequeue:PTaskerTask;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get and remove the first task from the Tasker list</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Return | ||
+ | | Dequeued Task or nil on failure (or list empty) | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TaskerCheck:LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Check if the tasker list is empty or contains tasks</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if the list contains tasks, ERROR_NO_MORE_ITEMS if list is empty or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | Called by clock interrupt with IRQ or FIQ disabled and running on the IRQ or FIQ thread | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TaskerTrigger:LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Dequeue all tasks in the tasker list and perform the requested task for each</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Return | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | Called by clock interrupt with IRQ or FIQ disabled and running on the IRQ or FIQ thread | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TaskerGetCount:LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current tasker count</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | |||
+ | '''RTL initialize and exit functions''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure SysInitProc;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure SysExitProc;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SysInitCompleted:Boolean;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | |||
+ | '''RTL process functions''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SysGetProcessID:SizeUInt;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | |||
+ | '''RTL thread manager functions''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadMain(Parameter:Pointer):PtrInt;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SysBeginThread(SignalAction:Pointer; StackSize:PtrUInt; ThreadFunction:TThreadFunc; ThreadParameter:Pointer; CreationFlags:DWORD; var ThreadId:TThreadID):TThreadID;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SysBeginThreadEx(SignalAction:Pointer; StackSize:PtrUInt; ThreadFunction:TThreadFunc; ThreadParameter:Pointer; CreationFlags:DWORD; Priority,Affinity,CPU:LongWord; Name:PChar; var ThreadId:TThreadID):TThreadID;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure SysEndThread(ExitCode:DWORD);</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SysSuspendThread(ThreadHandle:TThreadID):DWORD;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SysResumeThread(ThreadHandle:TThreadID):DWORD;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SysKillThread(ThreadHandle:TThreadID):DWORD;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SysCloseThread(ThreadHandle:TThreadID):DWORD;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure SysThreadSwitch;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SysWaitForThreadTerminate(ThreadHandle:TThreadID; TimeoutMs:LongInt):DWORD;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Timeout | ||
+ | | 0=No Timeout | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SysThreadSetPriority(ThreadHandle:TThreadID; Priority:LongInt):Boolean; </pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | -15..+15, 0=Normal | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SysThreadGetPriority(ThreadHandle:TThreadID):LongInt;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SysGetCurrentThreadId:TThreadID;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure SysSetThreadDebugNameA(ThreadHandle:TThreadID; const ThreadName:AnsiString);</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure SysSetThreadDebugNameU(ThreadHandle:TThreadID; const ThreadName:UnicodeString);</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure SysInitCriticalSection(var CriticalSection);</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure SysDoneCriticalSection(var CriticalSection);</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure SysEnterCriticalSection(var CriticalSection);</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SysTryEnterCriticalSection(var CriticalSection):LongInt;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure SysLeaveCriticalSection(var CriticalSection);</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure SysInitThreadVar(var Offset:DWORD; Size:DWORD);</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SysRelocateThreadVar(Offset:DWORD):Pointer;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure SysAllocateThreadVars;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure SysReleaseThreadVars;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SysBasicEventCreate(EventAttributes:Pointer; AManualReset,InitialState:Boolean; const Name:AnsiString):PEventState;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure SysBasicEventDestroy(State:PEventState);</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure SysBasicEventResetEvent(State:PEventState);</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure SysBasicEventSetEvent(State:PEventState);</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SysBasicEventWaitFor(Timeout:Cardinal; State:PEventState):LongInt; </pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Timeout | ||
+ | | 0=No Timeout | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SysRTLEventCreate:PRTLEvent;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure SysRTLEventDestroy(AEvent:PRTLEvent);</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure SysRTLEventSetEvent(AEvent:PRTLEvent);</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure SysRTLEventResetEvent(AEvent:PRTLEvent);</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure SysRTLEventWaitFor(AEvent:PRTLEvent);</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure SysRTLEventWaitForTimeout(AEvent:PRTLEvent; Timeout:LongInt);</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Timeout | ||
+ | | 0=No Timeout | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SysSemaphoreInit:Pointer;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure SysSemaphoreDestroy(const Semaphore:Pointer);</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure SysSemaphorePost(const Semaphore:Pointer);</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure SysSemaphoreWait(const Semaphore:Pointer);</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | |||
+ | '''Thread helper functions''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SpinGetCount:LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function MutexGetCount:LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function CriticalSectionGetCount:LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SemaphoreGetCount:LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SynchronizerGetCount:LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ConditionGetCount:LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current condition count</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function CompletionGetCount:LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current completion count</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ListGetCount:LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current list count</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function QueueGetCount:LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadGetCount:LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadTlsGetCount:LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadAllocateStack(StackSize:LongWord):Pointer;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure ThreadReleaseStack(StackBase:Pointer; StackSize:LongWord);</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadSetupStack(StackBase:Pointer; StartProc:TThreadStart; ReturnProc:TThreadEnd; Parameter:Pointer):Pointer;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadSnapshotCreate:PThreadSnapshot;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadSnapshotDestroy(ASnapshot:PThreadSnapshot):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function MessageslotGetCount:LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function MailslotGetCount:LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function BufferGetCount:LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function EventGetCount:LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TimerGetCount:LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function WorkerGetCount:LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function WorkerGetPriorityCount:LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ListTypeToString(ListType:LongWord):String;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function QueueTypeToString(QueueType:LongWord):String;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadTypeToString(ThreadType:LongWord):String;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadStateToString(ThreadState:LongWord):String;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function ThreadPriorityToString(ThreadPriority:LongWord):String;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure ThreadLog(Level:LongWord; const AText:String);</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure ThreadLogInfo(const AText:String); inline;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure ThreadLogWarn(const AText:String); inline;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure ThreadLogError(const AText:String); inline;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure ThreadLogDebug(const AText:String); inline;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | |||
+ | '''Scheduler helper functions''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SchedulerGetListFlags(ListType:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SchedulerGetQueueFlags(QueueType:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SchedulerGetQueueHandle(CPUID:LongWord; QueueType:LongWord):TQueueHandle;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SchedulerGetQueueHandleEx(CPUID:LongWord; Priority:LongWord):TQueueHandle;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SchedulerGetThreadCount(CPUID:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SchedulerGetThreadQuantum(CPUID:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SchedulerGetThreadHandle(CPUID:LongWord; ThreadType:LongWord):TThreadHandle;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SchedulerGetPriorityMask(CPUID:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SchedulerGetPriorityQuantum(Priority:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SchedulerSetPriorityQuantum(Priority,Quantum:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SchedulerGetMigrationQuantum:LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SchedulerGetStarvationQuantum(CPUID:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SchedulerGetThreadNext:LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SchedulerGetThreadMigration:LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SchedulerGetThreadPreempt(CPUID:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SchedulerGetThreadAllocation(CPUID:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SchedulerMigrationToString(Migration:LongWord):String;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SchedulerPreemptToString(Preempt:LongWord):String;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function SchedulerAllocationToString(Allocation:LongWord):String;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | |||
+ | '''Timer helper functions''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TimerGetListFlags:LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function TimerGetMessageslotFlags:LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | |||
+ | '''Worker helper functions''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function WorkerGetMessageslotFlags:LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
Return to [[Unit_Reference|Unit Reference]] | Return to [[Unit_Reference|Unit Reference]] |
Latest revision as of 04:40, 10 October 2023
Return to Unit Reference
Description
Ultibo Threads Interface unit
LOCKING PRIMITIVES
Spin -
A simple spin lock for fast mutually exclusive access to data. Threads "spin" while waiting to acquire the lock and do not yield the CPU unless pre-empted.
Non recursive (can only be acquired once by the same thread)
Includes IRQ/FIQ entry and exit routines to Save/Restore the IRQ/FIQ state.
Suitable for use by Interrupt handlers if non interrupt callers use the IRQ/FIQ entry and exit routines to Lock and Unlock.
Suitable for use on multiprocessor systems if the lock is allocated from shared memory (Determined during initialization).
Not recommended for long held operations or holding during I/O operations.
Access is not serialized, the next thread to try obtaining the lock when it is released will succeed even if that thread was not the first waiting.
Usage:
Create/Destroy
Spin locks are created using SpinCreate() and destroyed using SpinDestroy(), these functions should not be called from within an Interrupt handler. Lock/Unlock (Data accessed only by threads)
To synchronize data access between threads each thread should call SpinLock() before accessing the data and SpinUnlock() when finished accessing the data. These calls do not affect the state of IRQs or FIQs and therefore do not impact interrupt latency. Lock/Unlock (Data accessed by threads and interrupt handlers)
To use a Spin lock to synchronize data access between threads and an interrupt handler each thread should call SpinLockIRQ() or SpinLockFIQ(), depending on whether the interrupt handler is servicing IRQ or FIQ requests, before accessing the data and SpinUnlockIRQ() or SpinUnlockFIQ() when finished accessing the data. These calls disable interrupts before acquiring the lock (with deadlock protection) and restore interrupts after releasing the lock and therefore should only be used to protect very short sections of code accessing shared data to minimize the impact on interrupt latency.
Interrupt handlers should call SpinLock() before accessing the data and SpinUnlock() when finished accessing the data. In a Uniprocessor system it is technically not necessary for interrupt handlers to call lock/unlock as the use of IRQ/FIQ disable/enable will prevent interrupt handlers from executing while a thread has the lock. On a Multiprocessor system however interrupt handlers can execute on one processor while a thread is executing on another (which will not deadlock), to correctly synchronize data access both threads and interrupt handlers should call the appropriate lock/unlock before and after access to the data.
Lock Hierarchy -
It is safe to acquire one lock using SpinLock() then another lock using SpinLock() and then release them in reverse order.
It is also safe to acquire one lock using SpinLock() then another lock using SpinLockIRQ(or FIQ)() and then release them in reverse order.
It is NOT safe to acquire one lock using SpinLockIRQ(or FIQ)() then another lock using SpinLock() and then release them in reverse order. This is because the first SpinLockIRQ(or FIQ)() can disable the scheduling and prevent thread preemption. If another thread is already holding the second lock then this sequence will deadlock (except on a multicore system where the other thread is running on a different CPU).
It is also safe to acquire one lock using SpinLockIRQ(or FIQ)() then another lock using SpinLockIRQ(or FIQ)() and then release them in reverse order. In this case you must ensure that any thread acquiring the second lock also calls SpinLockIRQ(or FIQ)() to thereby avoid the deadlock.
It is NOT safe to acquire one lock using SpinLockIRQ(or FIQ)() then another lock using SpinLockIRQ(or FIQ)() and then release them in the SAME order. If the situation absolutely requires this behaviour then you must use SpinExchangeIRQ(or FIQ)() when holding both locks in order to reverse the order of the IRQ or FIQ re-enabling.
Mutex -
A mutually exclusive lock for controlling access to data. Threads yield while waiting to acquire the lock.
Non recursive (can only be acquired once by the same thread) (Recursive if MUTEX_FLAG_RECURSIVE specified)
Not suitable for use by Interrupt handlers.
Suitable for use on multiprocessor systems if the lock is allocated from shared memory (Determined during initialization).
Recommended for long held operations or holding during I/O operations.
Access is not serialized, the next thread to try obtaining the lock when it is released will succeed even if that thread was not the first waiting.
Usage:
Create/Destroy
Mutex locks are created using MutexCreate() and destroyed using MutexDestroy(). The MutexCreateEx() function allows additional options to be specified including if the creating thread is the initial owner and flags such as MUTEX_FLAG_RECURSIVE.
Lock/Unlock
To use a Mutex lock to synchronise data access between threads each thread should call MutexLock() before accessing the data and MutexUnlock() when finished accessing the data.
The MutexTryLock() function will attempt to lock the Mutex but will return an error instead of waiting for it if already locked.
Lock Hierarchy -
It is safe to acquire one lock using MutexLock() then another lock using MutexLock() and then release them in reverse order.
It is also safe to acquire one lock using MutexLock() then another lock using MutexLock() and then release them in the SAME order.
It is safe to acquire a Mutex lock using MutexLock() then aquire a Spin lock using SpinLockIRQ(or FIQ)().
It is NOT safe to acquire a Spin lock using SpinLockIRQ(or FIQ)() then acquire a Mutex lock using MutexLock().
CriticalSection -
A mutually exclusive lock for serializing access to data. Threads are placed on a wait list while waiting to acquire the lock.
Recursive (can be acquired multiple times by the same thread)
Not suitable for use by Interrupt handlers.
Suitable for use on multiprocessor systems.
Recommended for long held operations or holding during I/O operations.
Access is serialized, the next thread to obtain the lock when it is released will be the thread that has been waiting longest (See also stolen wakeups below).
Usage:
Create/Destroy
Critical Sections are created using CriticalSectionCreate() and destroyed using CriticalSectionDestroy().
The CriticalSectionCreateEx() function allows specifying additional flags and options for the lock.
Lock/Unlock
To use a Critical Section to synchronise data access between threads each thread should call CriticalSectionLock() before accessing the data and CriticalSectionUnlock() when finished accessing the data. A CriticalSectionTryLock() function is also available which will not wait if the lock is unavailable and will return immediately with an error.
Because Critical Sections place waiting threads on a wait list they also include the option to specify a timeout value so a thread will not wait indefinitely to obtain the lock by calling CriticalSectionLockEx().
The CriticalSectionLockEx() function will return ERROR_SUCCESS if the lock was obtained, ERROR_WAIT_TIMEOUT if the timeout value elapsed before obtaining the lock and ERROR_WAIT_ABANDONED if waiting was abandoned because the lock was destroyed or another thread called ThreadAbandon() with the handle of the waiting thread.
It is critical that the return value be checked when using timeouts in order to be certain that the lock was obtained before accessing the protected data, failure to do so may result in data corruption if multiple threads make changes at the same time.
Lock Hierarchy -
All serialized locks and synchronization objects generally follow the same principles as Mutex locks above.
It is safe to acquire and release most combinations of serialized objects in any order except where doing so would create a deadlock between threads where thread 1 holds object A is waiting on object B and thread 2 holds object B and is waiting on object A.
In all cases it is NOT safe to attempt to acquire a serialized object while IRQ or FIQ are disabled such as after calling SpinLockIRQ(or FIQ)()
Semaphore -
A counted serialization object that allows threads to proceed until the count reaches zero after which threads will be made to wait until the count is increased by another thread (or interrupt handler) calling signal.
Suitable for use by Interrupt handlers for signaling only if created with SEMAPHORE_FLAG_IRQ or FIQ (Interrupt handlers must not call wait).
Suitable for use on multiprocessor systems.
Access is serialized, the next thread to acquire the semaphore when it is signaled will be the thread that has been waiting longest (See also stolen wakeups below).
Usage:
Create/Destroy
Semaphores are created using SemaphoreCreate() and destroyed using SemaphoreDestroy(). With additional flags and options available by calling SemaphoreCreateEx(). The initial count of the Semaphore must be specified when calling create, in many usages the count will begin at zero but any value required by the application can be specified.
Wait/Signal
Threads consume the available count (or wait for count to be available) by calling SemaphoreWait() or SemaphoreWaitEx() if a timeout value is required.
Threads (or interrupt handlers) signal available count by calling SemaphoreSignal() or SemaphoreSignalEx() which allows increasing the count by values greater than one.
Lock Hierarchy -
Similar rules apply to all other serialized objects except that Semaphores support passing the flag SEMAPHORE_FLAG_IRQ (or FIQ) to SemaphoreCreateEx() so that signalling via the SemaphoreSignal() functions may be called from an interrupt handler.
Synchronizer -
A reader/writer lock for serializing multiple concurrent reads and single writes to data. Threads are placed on a wait list while waiting to acquire the lock.
Recursive (reader lock can be acquired multiple times by the same thread or by other threads/writer lock can be acquired multiple times by the same thread).
Not suitable for use by Interrupt handlers.
Suitable for use on multiprocessor systems.
Recommended for long held operations or holding during I/O operations.
Access is serialized, the next thread to obtain the lock when it is released will be the thread that has been waiting longest (See also stolen wakeups below).
Usage:
Create/Destroy
Synchronizers are created using SynchronizerCreate() or SynchronizerCreateEx() and destroyed using SynchronizerDestroy().
Lock/Unlock
Threads wanting read access to the protected data call SynchronizerReaderLock() and SynchronizerReaderUnlock() to obtain and release the lock. While one or more threads holds the reader lock no thread can obtain the writer lock.
A thread holding the reader lock can convert it to the writer lock by calling SynchronizerReaderConvert() but if any other thread is also holding the reader lock it will be placed in a wait list to wait until all threads have released the reader lock.
Threads wanting write access to the protected data call SynchronizerWriterLock() and SynchronizerWriterUnlock() to obtain and release the lock. While any thread holds the writer lock no thread can obtain the reader lock.
A thread holding the writer lock can convert it to the reader lock by calling SynchronizerWriterConvert(), because the writer lock is exclusive the thread will always obtain the reader lock immediately. All other threads currently waiting for the reader lock will also be released and given access.
Extended versions of the lock and convert functions for both reader and writer locks are available which allow specifying a timeout value to give up waiting after a specified time.
Lock Hierarchy -
The rules for Synchronizers are the same as those that apply to other serialized objects such as CriticalSection.
Condition -
A condition variable is used for coordinating synchronized access to resources by multiple threads. Condition variables are similar in concept to both Semaphores and Events but do not retain any internal state information so threads always wait until they are woken or the specified timeout interval expires.
Not suitable for use by Interrupt handlers.
Suitable for use on multiprocessor systems.
Access is serialized, the next thread released when a condition is woken will be the thread that has been waiting longest (See also stolen wakeups below).
Usage:
Create/Destroy
Conditions are created using ConditionCreate() and destroyed using ConditionDestroy().
Wait/Wake
Threads call ConditionWait() to begin waiting for the condition to be woken, additional versions of wait exist that allow releasing another lock before waiting and reacquiring it when the thread is woken after waiting.
These are ConditionWaitMutex(), ConditionWaitSynchronizer(), ConditionWaitCriticalSection() which apply to Mutex, Synchronizer and CriticalSection objects respectively.
Calling ConditionWake() will release one thread that is currently waiting for the condition, the ConditionWakeAll() function will release all threads waiting for the condition.
Lock Hierarchy -
The rules for Conditions are the same as those that apply to other serialized objects such as CriticalSection and Synchronizers.
Completion -
A completion is similar in concept to both condition variables and events but behaves differently to each of them. Completions are designed to be similar to the Linux synchronization object of the same name and provide a light weight mechanism for allowing one or more threads to wait for a signal that they can proceed. The completion differs from a condition variable because it maintains an internal state, once the state has been set (complete) threads pass through the completion without waiting (until the state is reset). This is similar to an event (see below) but in the case of a completion the state remains set indefinitely or until reset is called, a completion also allows explicitly releasing one thread at a time or all threads at once. More generally the event was created to model a behaviour that is similar to the same object in Windows and the completion models the Linux object instead.
Completions can use a counted state rather than a single state if they are created with COMPLETION_FLAG_COUNTED, this is to mimic the implementation of the Linux variation however there is a slight but important change in the way counted completions are implemented in Ultibo. The Linux completion sets the count to UMAX_INT / 2 on complete_all() which is documented as "effectively infinite". This is of course incorrect and seriously flawed because the count value is only set to a little over 2 billion, a long running application could easily consume this count with calls to wait_for_completion() and then the application would potentially fail without explanation.
To prevent this same fatal flaw the Ultibo implementation sets the count at LongWord(-1) on CompletionCompleteAll() and all other operations check for this value before incrementing or decrementing the count further. In this way the setting of complete all is genuinely infinite and will not fail on a long running application.
Suitable for use by Interrupt handlers to call complete or reset only if created with COMPLETION_FLAG_IRQ or FIQ (Interrupt handlers must not call wait).
Suitable for use on multiprocessor systems.
Access is serialized, the next thread released when a completion is set will be the thread that has been waiting longest (See also stolen wakeups below).
Usage:
Create/Destroy
Completions are created using CompletionCreate() and destroyed using CompletionDestroy().
Wait/Reset/Complete
Threads call CompletionWait() to either wait for a completion to be set or proceed immediately if it is already set, for counted completions the count is decremented (if not -1) and if the count reaches 0 the state of the completion is reset. A CompletionTryWait() function is available to check the state and return immediately with an error if not set.
Threads (or interrupt handlers) set or reset the state of the completion by calling CompletionComplete(), CompletionReset() or CompletionCompleteAll().
See the header of each function for a detailed description of the behaviour in all applicable cases.
Lock Hierarchy -
The rules for Completions are the same as those that apply to other serialized objects such as CriticalSection and Synchronizers except that like Semaphores they may be signalled by interrupt handlers if the appropriate flags as passed to create.
THREAD HANDLING
List -
A linked list designed to provide the wait list functionality for threads, each thread record includes a list element and the list elements include a thread handle to allow resolution in both directions. Lists are used by all serialized objects to hold threads in an ordered wait list that can be safely manipulated in all scheduling states.
Lists are primarily intended to be used internally but are available for use by applications for appropriate cases.
Suitable for use by Interrupt handlers if created with appropriate flags.
Suitable for use on multiprocessor systems.
Usage:
Create/Destroy
Lists are created using ListCreate() or ListCreateEx() and destroyed using ListDestroy().
Add/Get/Insert/Remove
A complete set of functions exist for adding, removing and inserting elements into a list and for finding threads within a list.
See the header of each of the functions in the appropriate section below for more information.
Lock/Unlock
A pair of universal lock and unlock functions exist to acquire and release list locks with the appropriate IRQ (or FIQ) handling for the flags the list was created with. See ListLock() and ListUnlock() below for more information.
Queue -
An ordered linked list designed to provide scheduler queues for threads, each thread record includes a queue element and the queue elements include a thread handle to allow resolution in both directions.
Queues are primarily intended to be used internally but are available for use by applications for appropriate cases.
Suitable for use by Interrupt handlers if created with appropriate flags.
Suitable for use on multiprocessor systems.
Usage:
Create/Destroy
Queues are created using QueueCreate() or QueueCreateEx() and destroyed using QueueDestroy().
Enqueue/Dequeue/Insert/Delete/Increment/Decrement
A range of functions exist for adding, removing and inserting elements into a queue and for managing the elements within a queue.
See the header of each of the functions in the appropriate section below for more information.
Lock/Unlock
A pair of universal lock and unlock functions exist to acquire and release queue locks with the appropriate IRQ (or FIQ) handling for the flags the queue was created with. See QueueLock() and QueueUnlock() below for more information.
Message -
A simple record similar to the Windows MSG structure the TMessage contains fields whose purpose is opaque to the core of Ultibo and can be used for passing any type of information between threads or through other mechanisms.
No functions explicity exist to deal with messages, however they are used as the format for thread messages and are the record that is passed to ThreadSendMessage() and received from ThreadReceiveMessage(). Messages are also used as the record format for Messageslots (see below).
Thread -
Threads form the primary unit of code execution in Ultibo. It is not possible to create processes which run in their own protected address space, all threads run within the kernel and with full privilege so they can perform any operation required. The core of Ultibo always includes threading and multiple threads are created during the boot process to perform system critical functions.
The complete set of available thread functions are listed below and the header of each one includes more information including any important notes or restrictions to be aware of.
ADDITIONAL ITEMS
Messageslot -
The Messageslot allows multiple threads to wait on a single object for messages received from other sources. Where the thread message functions such as ThreadReceiveMessage() only allow a single thread to receive the message many threads can wait simultaneously on a Messageslot and will be woken in turn as new messages are received.
Suitable for use by Interrupt handlers for sending only if created with MESSAGESLOT_FLAG_IRQ or FIQ (Interrupt handlers must not call receive).
Suitable for use on multiprocessor systems.
Usage:
Create/Destroy
Messageslots are created using MessageslotCreate() or MessageslotCreateEx() and destroyed using MessageslotDestroy().
Send/Receive
Threads wait for messages by calling MessageslotReceive() or MessageslotReceiveEx() to wait with a timeout.
Messages are sent using MessageslotSend() if the Messageslot is full and no more messages can be queued then an error will be returned instead of waiting for more space to be available.
Mailslot -
The Mailslot is similar to the Messageslot above and allows multiple threads to wait for messages to be received. Unlike a Messageslot where the sender will not wait if there is no space available to send, in a mailslot both the sender and receiver will wait for either available space or received messages. Mailslot messages are also an arbitrary pointer which means practically anything can be sent as long as the content is recognized by both the sender and receiver.
Not suitable for use by Interrupt handlers.
Suitable for use on multiprocessor systems.
Usage:
Create/Destroy
Mailslots are created using MailslotCreate() and destroyed using MailslotDestroy().
Send/Receive
Threads wait for messages by calling MailslotReceive() or MailslotReceiveEx() to wait with a timeout.
Messages are sent using MailslotSend() or MailslotSendEx(), if the Mailslot is full and no more messages can be queued the sender will wait until more space becomes available.
Buffer -
A circular list which can hold blocks of memory, allocated records or any other type of pointer that needs to be acquired, used and later released as part of a data transfer or queuing mechanism. Buffers simply contain pointers so their content is completely up to the user to determine, the number of entries and the size of each entry must be specified when creating a Buffer.
Not suitable for use by Interrupt handlers.
Suitable for use on multiprocessor systems.
Usage:
Create/Destroy
Buffers are created using BufferCreate() or BufferCreateEx() and destroyed using BufferDestroy().
Get/Free
The next available buffer entry is obtained by calling BufferGet() or BufferGetEx() to specify a timeout.
When the buffer is no longer required it can be returned to the list by calling BufferFree() and will be made available again.
During initialization of the Buffer all entries can be enumerated (in order to set initial values etc) by calling BufferIterate() however once the Buffer is in operation (and any entries have been obtained) it is not valid to call iterate again.
Event -
Events are a serialization object modelled on the Windows object of the same name, they can be set to allow threads to pass through or reset to force threads to wait. Events can also be pulsed to allow a only single waiting thread to pass.
Not suitable for use by Interrupt handlers.
Suitable for use on multiprocessor systems.
Usage:
Create/Destroy
Events are created using EventCreate() or EventCreateEx() and destroyed using EventDestroy().
Wait/Set/Reset/Pulse
Threads call EventWait() to either wait for the Event to be set or pass through immediately if already set.
Calling EventSet(), EventReset() or EventPulse() changes the state of the Event and either allows threads to pass or require them to wait depending on the values defined when the Event was created.
See the description in the header of each function below for detailed information about the behaviour in each state.
Timer -
Timers provide a mechanism to request that a thread from the timer pool perform a specified function call in a certain number of milliseconds from the time the request was made. This can be a convenient way to retry an operation after a predetermined amount of time or to delay an operation until a certain amount of time has passed. Timers can be created as once off or recurring and can pass a supplied pointer to the called function.
Not suitable for use by Interrupt handlers.
Suitable for use on multiprocessor systems.
Usage:
Create/Destroy
Timers are created using TimerCreate() or TimerCreateEx() and destroyed using TimerDestroy().
Enable/Disable
Timers can be enabled or disabled using the TimerEnable() and TimerDisable() functions, calling TimerEnableEx() allows redefining some of the parameters specified during the call to TimerCreate() so an existing Timer can be reused for multiple purposes.
Worker -
The Worker thread pool provides a resource that can be used by system tasks and by applications as a convenient and reliable way to allocate work to other threads for asynchronous completion. The number of threads in the Worker pool can be dynamically increased or decreased to handle varying workloads. Using Worker threads to offload tasks can greatly simplify application design but does require attention be given to thread safety of data that is passed to Worker threads.
Not suitable for use by Interrupt handlers unless the WorkerScheduleIRQ or WorkerScheduleFIQ functions are used.
Suitable for use on multiprocessor systems.
Usage:
Schedule/Cancel
A task can be scheduled to a Worker thread by calling WorkerSchedule() or WorkerScheduleEx() depending on the parameters that need to be supplied. An already scheduled task can be cancelled by calling WorkerCancel() up until the point where the task is assigned to a Worker thread.
IRQ and FIQ Usage:
WorkerScheduleIRQ() and WorkerScheduleFIQ() are designed to allow calling from interrupt handlers (IRQ or FIQ) and provide deadlock prevention mechanisms.
WorkerScheduleIRQ() relies on the fact the scheduler will either be bound to an IRQ or an FIQ, in either case IRQ is disabled while the scheduler is active and in any calls with queue, list and thread locks that check for the scheduler assignment.
This means that an IRQ cannot occur when the scheduler is active or while it is blocked by a lock, calls to this function from a IRQ interrupt handler cannot deadlock.
WorkerScheduleFIQ() checks for the assignment of the scheduler, if the scheduler is bound to an FIQ then it proceeds as per the IRQ version because the FIQ cannot occur when the scheduler is active or while it is blocked by a lock. If the scheduler is bound to an IRQ then this function reverts to using the Tasker instead to transfer FIQ operations to an IRQ handler.
Both functions only support immediate scheduling of a one time task, delayed or repeating tasks cannot be scheduled.
It is safe to call either function from non interrupt code in order to allow shared code paths etc, however frequent calls to these functions from normal code can affect interrupt latency.
Tasker -
The Tasker is a mechanism for transferring work from a fast interrupt (FIQ) handler to an interrupt (IRQ) handler in order to allow access to certain operations which could otherwise deadlock. When the scheduler is bound to an IRQ then all queue, list and thread locks disable IRQ in order to prevent preemption by the scheduler, when IRQ is disabled then FIQ is still enabled and can preempt code that is holding an IRQ lock. If the FIQ handler attempts to access any of these locks then the handler can deadlock waiting for code that it had preempted.
In normal operation the clock interrupt is used to service the tasker list however it is board specific and could be assigned to either a different interrupt or a dedicated interrupt if required.
Suitable for use by Fast Interrupt handlers and Interrupt handlers (Not required for Interrupt handlers).
Suitable for use on multiprocessor systems.
Usage:
There are currently five Tasker functions available, TaskerThreadSendMessage(), TaskerMessageslotSend(), TaskerSemaphoreSignal(), TaskerCompletionReset() and TaskerCompletionComplete() which each perform the same function as their non Tasker equivalent.
The Tasker list is checked on each clock interrupt for tasks waiting to be triggered, the task is performed directly by the clock interrupt so the delay between request and trigger is no more than one clock interrupt interval.
Services
In addition to the various synchronization and serialization objects described above the following services are provided by this unit:
ThreadManager Thread Creation and Stack allocation Thread Termination, Stack deallocation and cleanup Thread Functions (Sleep/Kill/Suspend/Resume etc) IRQ Thread (Boot process becomes the IRQ or FIQ Thread) FIQ Thread Idle Thread (An always ready thread which measures utilization) Main Thread (Main thread executes PASCALMAIN) Timer Threads (Pool of threads to service Timer requests) Worker Threads (Pool of threads to service Worker requests) Thread Scheduling, Allocation, Priority, Affinity and Migration
Stolen wakeups
Locking and synchronization types such as CriticalSection, Semaphore, Condition, Event, Messageslot and Mailslot use a wait queue internally to determine which thread has been waiting the longest. When a thread is removed from the wait queue so it can obtain the lock, semaphore, event etc there is a small window where the lock, semaphore or event may be acquired by another thread before the thread that was just woken from the wait queue. This is called a stolen wakeup and can happen in many systems including Windows and Linux, in some systems the caller is expected to check the state of a predicate value on return in order to detect a stolen wakeup. In Ultibo the code within the lock, semaphore, event etc functions automatically checks for a stolen wakeup and takes appropriate action to either return the thread to the wait queue or return with a timeout (where appropriate) so that the caller can respond accordingly.
In no case will a call to a locking or synchronization function fail due to a stolen wakeup, the worst case scenario is that a thread may wait longer than it should have (ie it is returned to the back of the queue) or it may return with a timeout before the specified timeout value has expired.
Constants
LOCK_FLAG_*
LOCK_FLAG_NONE = $00000000;
|
|
LOCK_FLAG_IRQ = $00000001;
|
|
LOCK_FLAG_FIQ = $00000002;
|
|
LOCK_FLAG_IRQFIQ = $00000004;
|
SPIN_SIGNATURE_*
SPIN_SIGNATURE = $0FEC3B82;
|
SPIN_STATE_*
SPIN_STATE_UNLOCKED = 0;
|
|
SPIN_STATE_LOCKED = 1;
|
MUTEX_SIGNATURE_*
MUTEX_SIGNATURE = $1C5D7FA4;
|
MUTEX_STATE_*
MUTEX_STATE_UNLOCKED = 0;
|
|
MUTEX_STATE_LOCKED = 1;
|
MUTEX_FLAG_*
MUTEX_FLAG_NONE = $00000000;
|
|
MUTEX_FLAG_RECURSIVE = $00000001;
|
Mutex can be locked multiple times by the same thread if set (Must be unlocked the same number of times) |
MUTEX_FLAG_ERRORCHECK = $00000002;
|
Mutex will perform a deadlock check if set, will return with an error if already owned by the same thread (and not recursive) |
CRITICAL_SECTION_SIGNATURE_*
CRITICAL_SECTION_SIGNATURE = $25F3AE01;
|
CRITICAL_SECTION_STATE_*
CRITICAL_SECTION_STATE_UNLOCKED = 0;
|
|
CRITICAL_SECTION_STATE_LOCKED = 1;
|
SEMAPHORE_SIGNATURE_*
SEMAPHORE_SIGNATURE = $390A1EB4;
|
SEMAPHORE_FLAG_*
SEMAPHORE_FLAG_NONE = LOCK_FLAG_NONE;
|
|
SEMAPHORE_FLAG_IRQ = LOCK_FLAG_IRQ;
|
|
SEMAPHORE_FLAG_FIQ = LOCK_FLAG_FIQ;
|
|
SEMAPHORE_FLAG_IRQFIQ = LOCK_FLAG_IRQFIQ;
|
SYNCHRONIZER_SIGNATURE_*
SYNCHRONIZER_SIGNATURE = $C5D081FB;
|
SYNCHRONIZER_STATE_*
SYNCHRONIZER_STATE_UNLOCKED = 0;
|
|
SYNCHRONIZER_STATE_READER_LOCKED = 1;
|
|
SYNCHRONIZER_STATE_WRITER_LOCKED = 2;
|
SYNCHRONIZER_FLAG_*
SYNCHRONIZER_FLAG_NONE = $00000000;
|
|
SYNCHRONIZER_FLAG_READ_PRIORITY = $00000001;
|
Synchronizer prioritises readers over writers |
SYNCHRONIZER_FLAG_WRITE_PRIORITY = $00000002;
|
Synchronizer prioritises writers over readers |
CONDITION_*
CONDITION_SIGNATURE = $D14D3C0A;
|
CONDITION_FLAG_*
CONDITION_FLAG_NONE = $00000000;
|
CONDITION_LOCK_FLAG_*
CONDITION_LOCK_FLAG_NONE = $00000000;
|
|
CONDITION_LOCK_FLAG_WRITER = $00000001;
|
Condition should release and acquire the writer lock on a Synchronizer when ConditionWaitSynchronizer is called (otherwise release and acquire the reader lock) |
COMPLETION_*
COMPLETION_SIGNATURE = $FCE24CA1;
|
COMPLETION_STATE_*
COMPLETION_STATE_RESET = 0;
|
|
COMPLETION_STATE_COMPLETE = 1;
|
COMPLETION_FLAG_*
COMPLETION_FLAG_NONE = LOCK_FLAG_NONE;
|
|
COMPLETION_FLAG_IRQ = LOCK_FLAG_IRQ;
|
Disable IRQ during completion operations (Wait/Reset/Complete) |
COMPLETION_FLAG_FIQ = LOCK_FLAG_FIQ;
|
Disable FIQ during completion operations (Wait/Reset/Complete) |
COMPLETION_FLAG_IRQFIQ = LOCK_FLAG_IRQFIQ;
|
Disable IRQ and FIQ during completion operations (Wait/Reset/Complete) |
COMPLETION_FLAG_COUNTED = $00000008;
|
Use a counted value instead of a single state (Affects behaviour of Wait and Complete) |
LIST_SIGNATURE_*
LIST_SIGNATURE = $4A98BE2A;
|
LIST_TYPE_*
LIST_TYPE_NOT_SPECIFIED = 0;
|
A generic thread list without a specific purpose |
LIST_TYPE_WAIT_SECTION = 1;
|
A Critical Section Wait List |
LIST_TYPE_WAIT_SEMAPHORE = 2;
|
A Semaphore Wait List |
LIST_TYPE_WAIT_SYNCHRONIZER = 3;
|
A Synchronizer Wait List |
LIST_TYPE_WAIT_CONDITION = 4;
|
A Condition Wait List |
LIST_TYPE_WAIT_COMPLETION = 5;
|
A Condition Wait List |
LIST_TYPE_WAIT_EVENT = 6;
|
An Event Wait List |
LIST_TYPE_WAIT_THREAD = 7;
|
A Thread Wait List |
LIST_TYPE_WAIT_MESSAGESLOT = 8;
|
A Messageslot Wait List |
LIST_TYPE_WAIT_OTHER = 9;
|
Another type of Wait List (Suitable for passing to ThreadWait/ThreadWaitEx/ThreadWaitMultiple/ThreadRelease) |
LIST_FLAG_*
LIST_FLAG_NONE = LOCK_FLAG_NONE;
|
|
LIST_FLAG_IRQ = LOCK_FLAG_IRQ;
|
|
LIST_FLAG_FIQ = LOCK_FLAG_FIQ;
|
|
LIST_FLAG_IRQFIQ = LOCK_FLAG_IRQFIQ;
|
QUEUE_SIGNATURE_*
QUEUE_SIGNATURE = $57A3BF9E;
|
QUEUE_TYPE_*
QUEUE_TYPE_NOT_SPECIFIED = 0;
|
A generic thread queue without a specific purpose |
QUEUE_TYPE_SCHEDULE_SLEEP = 1;
|
A Scheduler Sleep Queue |
QUEUE_TYPE_SCHEDULE_TIMEOUT = 2;
|
A Scheduler Timeout Queue |
QUEUE_TYPE_SCHEDULE_TERMINATION = 3;
|
A Scheduler Termination Queue (Threads are placed on termination queue when they exit or are terminated) |
QUEUE_TYPE_SCHEDULE_NONE = 4;
|
A Scheduler No Priority Queue (Only used for IRQ/FIQ threads which are never selected for scheduling) |
QUEUE_TYPE_SCHEDULE_IDLE = 5;
|
A Scheduler Idle Priority Queue |
QUEUE_TYPE_SCHEDULE_LOWEST = 6;
|
A Scheduler Lowest Priority Queue |
QUEUE_TYPE_SCHEDULE_LOWER = 7;
|
A Scheduler Lower Priority Queue |
QUEUE_TYPE_SCHEDULE_NORMAL = 8;
|
A Scheduler Normal Priority Queue |
QUEUE_TYPE_SCHEDULE_HIGHER = 9;
|
A Scheduler Higher Priority Queue |
QUEUE_TYPE_SCHEDULE_HIGHEST = 10;
|
A Scheduler Highest Priority Queue |
QUEUE_TYPE_SCHEDULE_CRITICAL = 11;
|
A Scheduler Critical Priority Queue |
QUEUE_FLAG_*
NONE = LOCK_FLAG_NONE;
|
|
QUEUE_FLAG_IRQ = LOCK_FLAG_IRQ;
|
|
QUEUE_FLAG_FIQ = LOCK_FLAG_FIQ;
|
|
QUEUE_FLAG_IRQFIQ = LOCK_FLAG_IRQFIQ;
|
|
QUEUE_FLAG_DESCENDING = $00000008;
|
|
QUEUE_FLAG_DELTA = $00000010;
|
QUEUE_KEY_*
QUEUE_KEY_NONE = Integer($7FFFFFFF);
|
Null key value returned from an empty Queue |
QUEUE_KEY_MAX = Integer($7FFFFFFE);
|
Max key that can be ordered in a Queue |
QUEUE_KEY_MIN = Integer($80000000);
|
Min key that can be ordered in a Queue |
THREAD_SIGNATURE_*
THREAD_SIGNATURE = $6C2BA10F;
|
THREAD_TYPE_*
THREAD_TYPE_NORMAL = 0;
|
A Normal thread (No special case handling) |
THREAD_TYPE_IDLE = 1;
|
An Idle thread (Used to calculate ultilization and provide an always ready thread) |
THREAD_TYPE_IRQ = 2;
|
An IRQ thread (Used by the IRQ handler during interrupt time) |
THREAD_TYPE_FIQ = 3;
|
An FIQ thread (Used by the FIQ handler during interrupt time) |
THREAD_TYPE_SWI = 4;
|
A Software Interrupt (SWI) thread (Used by the SWI handler during a system call) |
THREAD_FLAG_*
THREAD_FLAG_NONE = $00000000;
|
|
THREAD_FLAG_PERSIST = $00000001;
|
If set thread handle will persist until explicitly destroyed (Otherwise destroyed after termination quantum has elapsed) |
THREAD_FLAG_CANCELLED = $00000002;
|
Indicates that thread has been cancelled, for support of external thread APIs eg. pThreads (Not used internally by Ultibo) |
THREAD_FLAG_CANCEL_DISABLE = $00000004;
|
Indicates that thread cancellation is disabled for a thread, for support of external thread APIs eg. pThreads (Not used internally by Ultibo) |
THREAD_FLAG_CANCEL_ASYNCHRONOUS = $00000008;
|
Indicates that asynchronous thread cancellation is enabled for a thread, for support of external thread APIs eg. pThreads (Not used internally by Ultibo) |
THREAD_FLAG_INTERNAL = THREAD_FLAG_NONE + $80000000;
|
Note: Temporary value to avoid warning |
THREAD_STATE_*
THREAD_STATE_RUNNING = 1;
|
Thread is currently running |
THREAD_STATE_READY = 2;
|
Thread is on ready queue |
THREAD_STATE_SLEEP = 3;
|
Thread is sleeping |
THREAD_STATE_SUSPENDED = 4;
|
Thread is suspended |
THREAD_STATE_WAIT = 5;
|
Thread is on a wait list |
THREAD_STATE_WAIT_TIMEOUT = 6;
|
Thread is on a wait list with timeout |
THREAD_STATE_RECEIVE = 7;
|
Thread is waiting to receive a message |
THREAD_STATE_RECEIVE_TIMEOUT = 8;
|
Thread is waiting to receive a message with timeout |
THREAD_STATE_HALTED = 9;
|
Thread has been halted (Due to an unhandled exception etc) |
THREAD_STATE_TERMINATED = 10;
|
Thread has been terminated |
THREAD_PRIORITY_*
THREAD_PRIORITY_NONE = 0;
|
Only used for IRQ/FIQ threads which are never selected for scheduling |
THREAD_PRIORITY_IDLE = 1;
|
|
THREAD_PRIORITY_LOWEST = 2;
|
|
THREAD_PRIORITY_LOWER = 3;
|
|
THREAD_PRIORITY_NORMAL = 4;
|
|
THREAD_PRIORITY_HIGHER = 5;
|
|
THREAD_PRIORITY_HIGHEST = 6;
|
|
THREAD_PRIORITY_CRITICAL = 7;
|
|
THREAD_PRIORITY_DEFAULT = THREAD_PRIORITY_NORMAL;
|
Default thread priority |
THREAD_PRIORITY_MINIMUM = THREAD_PRIORITY_IDLE;
|
Minimum thread priority |
THREAD_PRIORITY_MAXIMUM = THREAD_PRIORITY_CRITICAL;
|
Maximum thread priority |
THREAD_PRIORITY_COUNT = THREAD_PRIORITY_MAXIMUM + 1;
|
Number of thread priority levels |
Additional priority aliases for compatibility | |
THREAD_PRIORITY_BELOW_NORMAL = THREAD_PRIORITY_LOWER;
|
|
THREAD_PRIORITY_ABOVE_NORMAL = THREAD_PRIORITY_HIGHER;
|
|
THREAD_PRIORITY_TIME_CRITICAL = THREAD_PRIORITY_CRITICAL;
|
THREAD_NAME_*
THREAD_NAME_LENGTH = SIZE_64;
|
Length of thread name |
IRQ_THREAD_NAME = 'IRQ';
|
|
FIQ_THREAD_NAME = 'FIQ';
|
|
SWI_THREAD_NAME = 'SWI';
|
|
IDLE_THREAD_NAME = 'Idle';
|
|
MAIN_THREAD_NAME = 'Main';
|
|
TIMER_THREAD_NAME = 'Timer';
|
|
WORKER_THREAD_NAME = 'Worker';
|
|
TIMER_PRIORITY_THREAD_NAME = 'Priority Timer';
|
|
WORKER_PRIORITY_THREAD_NAME = 'Priority Worker';
|
|
RTL_THREAD_NAME = 'RTL Thread';
|
*_THREAD_PRIORITY
TIMER_THREAD_PRIORITY = THREAD_PRIORITY_NORMAL;
|
|
WORKER_THREAD_PRIORITY = THREAD_PRIORITY_NORMAL;
|
|
TIMER_PRIORITY_THREAD_PRIORITY = THREAD_PRIORITY_HIGHEST;
|
|
WORKER_PRIORITY_THREAD_PRIORITY = THREAD_PRIORITY_HIGHER;
|
THREAD_CREATE_*
THREAD_CREATE_NONE = $00000000;
|
|
THREAD_CREATE_SUSPENDED = $00000004;
|
THREAD_TLS_*
THREAD_TLS_FREE = $00000000;
|
|
THREAD_TLS_USED = $00000001;
|
|
THREAD_TLS_INVALID = $FFFFFFFF;
|
|
THREAD_TLS_MAXIMUM = SIZE_64;
|
The maximum number TLS index slots available |
THREAD_TLS_FLAG_*
THREAD_TLS_FLAG_NONE = $00000000;
|
|
THREAD_TLS_FLAG_FREE = $00000001;
|
If set then pointer in thread TLS index will be freed on ThreadReleaseTlsIndex or ThreadDestroy |
THREAD_LISTS_*
THREAD_LISTS_MAXIMUM = SIZE_64;
|
Maximum number of lists a thread can wait on at the same time |
MESSAGESLOT_SIGNATURE_*
MESSAGESLOT_SIGNATURE = $B631CE4B;
|
MESSAGESLOT_FLAG_*
MESSAGESLOT_FLAG_NONE = LOCK_FLAG_NONE;
|
|
MESSAGESLOT_FLAG_IRQ = LOCK_FLAG_IRQ;
|
|
MESSAGESLOT_FLAG_FIQ = LOCK_FLAG_FIQ;
|
|
MESSAGESLOT_FLAG_IRQFIQ = LOCK_FLAG_IRQFIQ;
|
MAILSLOT_SIGNATURE_*
MAILSLOT_SIGNATURE = $7A409BF3;
|
BUFFER_SIGNATURE_*
BUFFER_SIGNATURE = $830BEA71;
|
BUFFER_FLAG_*
BUFFER_FLAG_NONE = $00000000;
|
|
BUFFER_FLAG_SHARED = $00000001;
|
If set the buffer memory (Not the buffer entry itself) is allocated from shared memory |
EVENT_SIGNATURE_*
EVENT_SIGNATURE = $903BA69D;
|
EVENT_STATE_*
EVENT_STATE_UNSIGNALED = 0;
|
|
EVENT_STATE_SIGNALED = 1;
|
EVENT_FLAG_*
EVENT_FLAG_NONE = $00000000;
|
|
EVENT_FLAG_INITIAL_STATE = $00000001;
|
|
EVENT_FLAG_MANUAL_RESET = $00000002;
|
TIMER_SIGNATURE_*
TIMER_SIGNATURE = $AB7E07FB;
|
TIMER_STATE_*
TIMER_STATE_DISABLED = 0;
|
|
TIMER_STATE_ENABLED = 1;
|
TIMER_FLAG_*
TIMER_FLAG_NONE = $00000000;
|
|
TIMER_FLAG_RESCHEDULE = $00000001;
|
Timer should be rescheduled each time the event completes |
TIMER_FLAG_IMMEDIATE = $00000002;
|
Timer event should be executed immediately and then each interval milliseconds |
TIMER_FLAG_WORKER = $00000004;
|
Timer event should be executed by a worker thread instead of a timer thread |
TIMER_FLAG_PRIORITY = $00000008;
|
Timer event should be executed by a priority timer thread |
TIMER_KEY_*
TIMER_KEY_NONE = Integer($7FFFFFFF);
|
Null key value returned from an empty Timer list |
TIMER_KEY_MAX = Integer($7FFFFFFE);
|
Max key that can be ordered in a Timer list |
TIMER_KEY_MIN = Integer($80000000);
|
Min key that can be ordered in a Timer list |
WORKER_SIGNATURE_*
WORKER_SIGNATURE = $EF6A901B;
|
WORKER_FLAG_*
WORKER_FLAG_NONE = $00000000;
|
|
WORKER_FLAG_RESCHEDULE = $00000001;
|
Worker task should be rescheduled each time the task completes |
WORKER_FLAG_IMMEDIATE = $00000002;
|
Worker task should be executed immediately and then each interval milliseconds |
WORKER_FLAG_CANCEL = $00000004;
|
Internal flag to indicate the worker task should be cancelled next time the interval expires |
WORKER_FLAG_NOFREE = $00000008;
|
Internal flag to tell worker execute not to free the worker request when it is completed |
WORKER_FLAG_TERMINATE = $00000010;
|
Internal flag to tell worker execute to terminate the worker thread |
WORKER_FLAG_IRQ = $00000020;
|
Internal flag to tell worker execute to free IRQ memory when the request is completed |
WORKER_FLAG_FIQ = $00000040;
|
Internal flag to tell worker execute to free FIQ memory when the request is completed |
WORKER_FLAG_PRIORITY = $00000080;
|
Worker task should be executed by a priority worker thread |
WORKER_FLAG_INTERNAL = WORKER_FLAG_CANCEL or WORKER_FLAG_NOFREE or WORKER_FLAG_TERMINATE or WORKER_FLAG_IRQ or WORKER_FLAG_FIQ;
|
Internal only flags |
WORKER_FLAG_EXCLUDED_IRQ = WORKER_FLAG_RESCHEDULE or WORKER_FLAG_IMMEDIATE;
|
Excluded flags |
WORKER_FLAG_EXCLUDED_FIQ = WORKER_FLAG_RESCHEDULE or WORKER_FLAG_IMMEDIATE;
|
Excluded flags |
TASKER_TASK_*
TASKER_TASK_THREADSENDMESSAGE = 1;
|
Perform a ThreadSendMessage() function using the tasker list |
TASKER_TASK_MESSAGESLOTSEND = 2;
|
Perform a MessageslotSend() function using the tasker list |
TASKER_TASK_SEMAPHORESIGNAL = 3;
|
Perform a SemaphoreSignal() function using the tasker list |
TASKER_TASK_COMPLETIONRESET = 4;
|
Perform a CompletionReset() function using the tasker list |
TASKER_TASK_COMPLETIONCOMPLETE = 5;
|
Perform a CompletionComplete() or CompletionCompleteAll() function using the tasker list |
SCHEDULER_MIGRATION_*
SCHEDULER_MIGRATION_DISABLED = 0;
|
|
SCHEDULER_MIGRATION_ENABLED = 1;
|
SCHEDULER_PREEMPT_*
SCHEDULER_PREEMPT_DISABLED = 0;
|
|
SCHEDULER_PREEMPT_ENABLED = 1;
|
SCHEDULER_ALLOCATION_*
SCHEDULER_ALLOCATION_DISABLED = 0;
|
|
SCHEDULER_ALLOCATION_ENABLED = 1;
|
SCHEDULER_MASK_*
SCHEDULER_MASK_NONE = (1 shl THREAD_PRIORITY_NONE);
|
|
SCHEDULER_MASK_IDLE = (1 shl THREAD_PRIORITY_IDLE);
|
|
SCHEDULER_MASK_LOWEST = (1 shl THREAD_PRIORITY_LOWEST);
|
|
SCHEDULER_MASK_LOWER = (1 shl THREAD_PRIORITY_LOWER);
|
|
SCHEDULER_MASK_NORMAL = (1 shl THREAD_PRIORITY_NORMAL);
|
|
SCHEDULER_MASK_HIGHER = (1 shl THREAD_PRIORITY_HIGHER);
|
|
SCHEDULER_MASK_HIGHEST = (1 shl THREAD_PRIORITY_HIGHEST);
|
|
SCHEDULER_MASK_CRITICAL = (1 shl THREAD_PRIORITY_CRITICAL);
|
SCHEDULER_QUANTUM_*
SCHEDULER_QUANTUM_NONE = 0;
|
|
SCHEDULER_QUANTUM_IDLE = 0;
|
|
SCHEDULER_QUANTUM_LOWEST = 1;
|
|
SCHEDULER_QUANTUM_LOWER = 2;
|
|
SCHEDULER_QUANTUM_NORMAL = 4;
|
|
SCHEDULER_QUANTUM_HIGHER = 6;
|
|
SCHEDULER_QUANTUM_HIGHEST = 8;
|
|
SCHEDULER_QUANTUM_CRITICAL = 10;
|
THREAD_LOG_*
THREAD_LOG_LEVEL_DEBUG = LOG_LEVEL_DEBUG;
|
Thread debugging messages |
THREAD_LOG_LEVEL_INFO = LOG_LEVEL_INFO;
|
Thread informational messages, such as a thread being created or destroyed |
THREAD_LOG_LEVEL_WARN = LOG_LEVEL_WARN;
|
Thread warning messages |
THREAD_LOG_LEVEL_ERROR = LOG_LEVEL_ERROR;
|
Thread error messages |
THREAD_LOG_LEVEL_NONE = LOG_LEVEL_NONE;
|
No Thread messages |
Type definitions
Spin entry
PSpinEntry = ^TSpinEntry;
TSpinEntry = record
Spin Properties | |
Signature:LongWord;
|
Signature for entry validation |
State:LongWord;
|
State of the lock (Locked/Unlocked) |
Mask:LongWord;
|
IRQ/FIQ Mask for Save/Restore |
Owner:TThreadHandle;
|
Currently owning thread (or INVALID_HANDLE_VALUE if not locked) |
Internal Properties | |
Prev:PSpinEntry;
|
Previous entry in Spin table |
Next:PSpinEntry;
|
Next entry in Spin table |
Statistics Properties | |
Mutex entry
PMutexEntry = ^TMutexEntry;
TMutexEntry = record
Mutex Properties | |
Signature:LongWord;
|
Signature for entry validation |
State:LongWord;
|
State of the lock (Locked/Unlocked) |
Owner:TThreadHandle;
|
Currently owning thread (or INVALID_HANDLE_VALUE if not locked) |
Yield:TThreadYield;
|
Yield function to call while waiting |
Count:LongWord;
|
Count of lock recursions (only if Flags includes MUTEX_FLAG_RECURSIVE) |
Flags:LongWord;
|
Mutex Flags (eg MUTEX_FLAG_RECURSIVE) |
SpinCount:LongWord;
|
Number of times to spin wait for lock before Yield is called (Always 0 if SCHEDULER_CPU_COUNT = 1) |
Internal Properties | |
Prev:PMutexEntry;
|
Previous entry in Mutex table |
Next:PMutexEntry;
|
Next entry in Mutex table |
Statistics Properties | |
Critical section entry
PCriticalSectionEntry = ^TCriticalSectionEntry;
TCriticalSectionEntry = record
Critical Section Properties | |
Signature:LongWord;
|
Signature for entry validation |
State:LongWord;
|
State of the lock (Locked/Unlocked) |
Count:LongWord;
|
Count of lock recursions |
Owner:TThreadHandle;
|
Currently owning thread (or INVALID_HANDLE_VALUE if not locked) |
SpinCount:LongWord;
|
Number of times to spin wait for lock before Wait is called (Always 0 if SCHEDULER_CPU_COUNT = 1) |
Lock:TSpinHandle;
|
Critical Section Lock |
List:TListHandle;
|
List of threads waiting on this CriticalSection (or INVALID_HANDLE_VALUE if never used) |
Wait:TThreadWait;
|
Wait function to call to wait on the CriticalSection if it is already locked |
WaitEx:TThreadWaitEx;
|
Wait function to call to wait with timeout on the CriticalSection if it is already locked |
Release:TThreadRelease;
|
Release function to call if any threads are waiting when CriticalSection is unlocked |
Abandon:TThreadAbandon;
|
Abandon function to call if any threads are waiting when CriticalSection is destroyed |
Internal Properties | |
Prev:PCriticalSectionEntry;
|
Previous entry in CriticalSection table |
Next:PCriticalSectionEntry;
|
Next entry in CriticalSection table |
Statistics Properties | |
Semaphore entry
PSemaphoreEntry = ^TSemaphoreEntry;
TSemaphoreEntry = record
Semaphore Properties | |
Signature:LongWord;
|
Signature for entry validation |
Count:LongWord;
|
Count for this Semaphore (Can be negative when Threads are waiting) |
Maximum:LongWord;
|
Maximum count for this Semaphore |
Flags:LongWord;
|
Semaphore Flags (eg SEMAPHORE_FLAG_IRQ) |
Lock:TSpinHandle;
|
Semaphore Lock |
List:TListHandle;
|
List of threads waiting on this Semaphore (or INVALID_HANDLE_VALUE if never used) |
Wait:TThreadWait;
|
Wait function to call to wait on the Semaphore if the count is equal to zero on SemaphoreWait |
WaitEx:TThreadWaitEx;
|
Wait function to call to wait with timeout on the Semaphore if the count is equal to zero on SemaphoreWait |
Release:TThreadRelease;
|
Release function to call if any threads are waiting on SemaphoreSignal |
Abandon:TThreadAbandon;
|
Abandon function to call if any threads are waiting when SemaphoreSignal is destroyed |
Internal Properties | |
Prev:PSemaphoreEntry;
|
Previous entry in Semaphore table |
Next:PSemaphoreEntry;
|
Next entry in Semaphore table |
Statistics Properties | |
Synchronizer entry
PSynchronizerEntry = ^TSynchronizerEntry;
TSynchronizerEntry = record
Synchronizer Properties | |
Signature:LongWord;
|
Signature for entry validation |
State:LongWord;
|
State of the lock (Locked/Unlocked) |
Lock:TSpinHandle;
|
Synchronizer Lock |
ReaderCount:LongWord;
|
Count of current reader locks |
WriterCount:LongWord;
|
Count of current writer lock recursions |
ReaderLast:TThreadHandle;
|
Last thread to acquire reader lock (or INVALID_HANDLE_VALUE if no reader) |
WriterOwner:TThreadHandle;
|
Currently owning writer thread (or INVALID_HANDLE_VALUE if no writer) |
ReaderList:TListHandle;
|
List of reader threads waiting on this Synchronizer (or INVALID_HANDLE_VALUE if never used) |
WriterList:TListHandle;
|
List of writer threads waiting on this Synchronizer (or INVALID_HANDLE_VALUE if never used) |
Wait:TThreadWait;
|
Wait function to call to wait on the Synchronizer if it is already locked |
WaitEx:TThreadWaitEx;
|
Wait function to call to wait with timeout on the Synchronizer if it is already locked |
Release:TThreadRelease;
|
Release function to call if any threads are waiting when Synchronizer is unlocked |
Abandon:TThreadAbandon;
|
Abandon function to call if any threads are waiting when Synchronizer is destroyed |
Internal Properties | |
Prev:PSynchronizerEntry;
|
Previous entry in Synchronizer table |
Next:PSynchronizerEntry;
|
Next entry in Synchronizer table |
Statistics Properties | |
Condition entry
PConditionEntry = ^TConditionEntry;
TConditionEntry = record
Condition Properties | |
Signature:LongWord;
|
Signature for entry validation |
Flags:LongWord;
|
Condition Flags (eg CONDITION_FLAG_NONE) |
Lock:TSpinHandle;
|
Condition Lock |
List:TListHandle;
|
List of threads waiting on this Condition (or INVALID_HANDLE_VALUE if never used) |
Wait:TThreadWait;
|
Wait function to call to wait on the Condition |
WaitEx:TThreadWaitEx;
|
Wait function to call to wait with timeout on the Condition |
Release:TThreadRelease;
|
Release function to call if any threads are waiting when Condition is woken |
Abandon:TThreadAbandon;
|
Abandon function to call if any threads are waiting when Condition is destroyed |
Internal Properties | |
Prev:PConditionEntry;
|
Previous entry in Condition table |
Next:PConditionEntry;
|
Next entry in Condition table |
Statistics Properties | |
Completion entry
PCompletionEntry = ^TCompletionEntry;
TCompletionEntry = record
Completion Properties | |
Signature:LongWord;
|
Signature for entry validation |
State:LongWord;
|
State of the completion (Reset/Complete) |
Count:LongWord;
|
Count of the completion (Only applicable if COMPLETION_FLAG_COUNTED) |
Flags:LongWord;
|
Completion Flags (eg COMPLETION_FLAG_IRQ) |
Lock:TSpinHandle;
|
Completion Lock |
List:TListHandle;
|
List of threads waiting on this Completion (or INVALID_HANDLE_VALUE if never used) |
Wait:TThreadWait;
|
Wait function to call to wait on the Completion |
WaitEx:TThreadWaitEx;
|
Wait function to call to wait with timeout on the Completion |
Release:TThreadRelease;
|
Release function to call if any threads are waiting when Completion is completed |
Abandon:TThreadAbandon;
|
Abandon function to call if any threads are waiting when Completion is destroyed |
Internal Properties | |
Prev:PCompletionEntry;
|
Previous entry in Completion table |
Next:PCompletionEntry;
|
Next entry in Completion table |
Statistics Properties | |
List entry
PListEntry = ^TListEntry;
TListEntry = record
List Properties | |
Signature:LongWord;
|
Signature for entry validation |
ListType:LongWord;
|
Type of this List (eg LIST_TYPE_WAIT_SECTION) |
Count:LongWord;
|
Count of items currently in this List |
Flags:LongWord;
|
List Flags (eg LIST_FLAG_IRQ) |
Lock:TSpinHandle;
|
List Lock |
First:PListElement;
|
First element in List |
Last:PListElement;
|
Last element in List |
Internal Properties | |
Prev:PListEntry;
|
Previous entry in List table |
Next:PListEntry;
|
Next entry in List table |
Statistics Properties | |
List element
PListElement = ^TListElement;
TListElement = record
Thread:TThreadHandle;
|
The thread referenced by this List element |
Prev:PListElement;
|
Previous element in List |
Next:PListElement;
|
Next element in List |
List handles
PListHandles = ^TListHandles;
TListHandles = array[0..THREAD_LISTS_MAXIMUM - 1] of TListHandle;
Queue entry
PQueueEntry = ^TQueueEntry;
TQueueEntry = record
Queue Properties | |
Signature:LongWord;
|
Signature for entry validation |
QueueType:LongWord;
|
Type of this Queue (eg QUEUE_TYPE_SCHEDULE_IDLE) |
Count:LongWord;
|
Count of items currently in this Queue |
Flags:LongWord;
|
Queue Flags (eg QUEUE_FLAG_IRQ) |
Lock:TSpinHandle;
|
Queue Lock |
First:PQueueElement;
|
First element in Queue |
Last:PQueueElement;
|
Last element in Queue |
Internal Properties | |
Prev:PQueueEntry;
|
Previous entry in Queue table |
Next:PQueueEntry;
|
Next entry in Queue table |
Statistics Properties | |
Queue element
PQueueElement = ^TQueueElement;
TQueueElement = record
Key:Integer;
|
Ordering key for Queue |
Thread:TThreadHandle;
|
The thread referenced by this Queue element |
Prev:PQueueElement;
|
Previous element in Queue |
Next:PQueueElement;
|
Next element in Queue |
Message list
PMessageList = ^TMessageList;
TMessageList = record
Header Properties | |
Maximum:LongWord;
|
Maximum number of messages in list |
Count:LongWord;
|
Current number of messages in list |
Start:LongWord;
|
First message available in list |
Internal Properties | |
List:PMessage;
|
Message list |
Statistics Properties | |
Message
PMessage = ^TMessage;
TMessage = record
Msg:PtrUInt;
|
|
wParam:PtrUInt;
|
|
lParam:PtrUInt;
|
|
Time:LongWord;
|
Thread entry
PThreadEntry = ^TThreadEntry;
TThreadEntry = record
Thread Properties | |
Signature:LongWord;
|
Signature for entry validation |
State:LongWord;
|
State of the Thread (eg THREAD_STATE_RUNNING) |
Flags:LongWord;
|
Flags of the Thread (eg THREAD_FLAG_PERSIST) |
Priority:LongWord;
|
Priority of the Thread (eg THREAD_PRIORITY_NORMAL) |
Affinity:LongWord;
|
CPU Affinity mask of the Thread |
StackBase:Pointer;
|
Base (Top) of the thread stack |
StackSize:LongWord;
|
Stack length in bytes |
Name:array[0..THREAD_NAME_LENGTH - 1] of Char;
|
The name of the Thread |
Lock:TSpinHandle;
|
Thread Lock |
Parent:TThreadHandle;
|
Handle of the parent thread |
Messages:TMessageList;
|
Messages sent to this thread |
TlsPointer:Pointer;
|
Thread Local Storage Memory (RTL ThreadVars) |
TlsTable:array[0..THREAD_TLS_MAXIMUM - 1] of Pointer;
|
Thread Local Storage Index Pointers (for ThreadGetTlsValue/ThreadSetTlsValue) |
TlsFlags:array[0..THREAD_TLS_MAXIMUM - 1] of LongWord;
|
Thread Local Storage Index Flags (eg THREAD_TLS_FLAG_FREE) |
ExitCode:LongWord;
|
Thread Exit Code |
LastError:LongWord;
|
Thread Last Error |
Locale:LCID;
|
Thread Locale |
Internal Properties | |
CurrentCPU:LongWord;
|
Saved current CPU from last ContextSwitch |
StackPointer:Pointer;
|
Saved current stack pointer from last ContextSwitch |
TargetCPU:LongWord;
|
Target CPU of the Thread for next ContextSwitch |
TargetPriority:LongWord;
|
Target Priority of the Thread for next ContextSwitch (eg THREAD_PRIORITY_NORMAL) |
List:TListHandle;
|
List of threads waiting on this thread (or INVALID_HANDLE_VALUE if never used) |
WaitList:TListHandle;
|
The wait list this thread is currently in (or INVALID_HANDLE_VALUE) |
WaitLists:PListHandles;
|
The wait lists this thread is currently in if doing a multiple wait (or nil) |
WaitResult:LongWord;
|
The result code for the last wait with timeout (eg WAIT_TIMEOUT) |
ReceiveResult:LongWord;
|
The result code for the last receive with timeout (eg WAIT_TIMEOUT) |
ListElement:TListElement;
|
List element for this thread when in a Wait List |
QueueElement:TQueueElement;
|
Queue element for this thread when in a Schedule Queue |
Prev:PThreadEntry;
|
Previous entry in Thread table |
Next:PThreadEntry;
|
Next entry in Thread table |
Statistics Properties | |
CreateTime:Int64;
|
The time when this thread was created |
ExitTime:Int64;
|
The time when this thread exited or was terminated |
KernelTime:Int64;
|
The total amount of time this thread has been in the running state (ie CPU time consumed) |
SwitchCount:Int64;
|
The number of times this thread has been selected to run by a context switch |
Thread snapshot
PThreadSnapshot = ^TThreadSnapshot;
TThreadSnapshot = record
Note: Data returned by ThreadSnapshotCreate | |
Snapshot Properties | |
Handle:TThreadHandle;
|
Handle of the thread |
State:LongWord;
|
State of the Thread (eg THREAD_STATE_RUNNING) |
Flags:LongWord;
|
Flags of the Thread (eg THREAD_FLAG_PERSIST) |
CPU:LongWord;
|
CPU from last ContextSwitch |
Priority:LongWord;
|
Priority of the Thread (eg THREAD_PRIORITY_NORMAL) |
Affinity:LongWord;
|
CPU Affinity mask of the Thread |
StackBase:Pointer;
|
Base (Top) of the thread stack |
StackSize:LongWord;
|
Stack length in bytes |
StackPointer:Pointer;
|
Stack pointer from last ContextSwitch |
Name:array[0..THREAD_NAME_LENGTH - 1] of Char;
|
The name of the Thread |
Parent:TThreadHandle;
|
Handle of the parent thread |
ExitCode:LongWord;
|
Thread Exit Code |
LastError:LongWord;
|
Thread Last Error |
Locale:LCID;
|
Thread Locale |
TargetCPU:LongWord;
|
Target CPU of the Thread for next ContextSwitch |
TargetPriority:LongWord;
|
Target Priority of the Thread for next ContextSwitch (eg THREAD_PRIORITY_NORMAL) |
CreateTime:Int64;
|
The time when this thread was created |
ExitTime:Int64;
|
The time when this thread exited or was terminated |
KernelTime:Int64;
|
The total amount of time this thread has been in the running state (ie CPU time consumed) |
SwitchCount:Int64;
|
The number of times this thread has been selected to run by a context switch |
Internal Properties | |
Next:PThreadSnapshot;
|
Next entry in Thread snapshot |
Messageslot entry
PMessageslotEntry = ^TMessageslotEntry;
TMessageslotEntry = record
Messageslot Properties | |
Signature:LongWord;
|
Signature for entry validation |
Flags:LongWord;
|
Messageslot Flags (eg MESSAGESLOT_FLAG_IRQ) |
Lock:TSpinHandle;
|
Messageslot Lock |
List:TListHandle;
|
List of threads waiting on this Messageslot (or INVALID_HANDLE_VALUE if never used) |
Messages:TMessageList;
|
Messageslot message queue |
Wait:TThreadWait;
|
Wait function to call to wait on the Messageslot if there are no messages |
WaitEx:TThreadWaitEx;
|
Wait function to call to wait with timeout on the Messageslot if there are no messages |
Release:TThreadRelease;
|
Release function to call if any threads are waiting when a message is sent |
Abandon:TThreadAbandon;
|
Abandon function to call if any threads are waiting when Messageslot is destroyed |
Internal Properties | |
Prev:PMessageslotEntry;
|
Previous entry in Messageslot table |
Next:PMessageslotEntry;
|
Next entry in Messageslot table |
Statistics Properties | |
Mailslot entry
PMailslotEntry = ^TMailslotEntry;
TMailslotEntry = record
Mailslot Properties | |
Signature:LongWord;
|
Signature for entry validation |
Maximum:LongWord;
|
Maximum number of messages in Mailslot |
Count:LongWord;
|
Current number of messages in Mailslot |
Start:LongWord;
|
First message available in Mailslot |
Lock:TSpinHandle;
|
Mailslot Lock |
Sender:TSemaphoreHandle;
|
Mailslot send Semaphore |
Receiver:TSemaphoreHandle;
|
Mailslot receive Semaphore |
Messages:PPtrInt;
|
Mailslot message queue |
Internal Properties | |
Prev:PMailslotEntry;
|
Previous entry in Mailslot table |
Next:PMailslotEntry;
|
Next entry in Mailslot table |
Statistics Properties | |
Buffer entry
PBufferEntry = ^TBufferEntry;
TBufferEntry = record
Buffer Properties | |
Signature:LongWord;
|
Signature for entry validation |
Size:LongWord;
|
Size of each buffer |
Count:LongWord;
|
Number of buffers |
Flags:LongWord;
|
Buffer Flags (eg BUFFER_FLAG_SHARED) |
Lock:TSpinHandle;
|
Buffer Lock |
Available:TSemaphoreHandle;
|
Buffer available Semaphore |
Buffers:PBufferItem;
|
Buffer list |
Internal Properties | |
Prev:PBufferEntry;
|
Previous entry in Buffer table |
Next:PBufferEntry;
|
Next entry in Buffer table |
First:PBufferItem;
|
First available buffer item |
Statistics Properties | |
Buffer item
PBufferItem = ^TBufferItem;
TBufferItem = record
Parent:TBufferHandle;
|
Handle of Buffer owning this item |
Next:PBufferItem;
|
Next item in list |
Buffer:Pointer;
|
Pointer to item data |
Reserved:LongWord;
|
Align to 16 bytes |
Event entry
PEventEntry = ^TEventEntry;
TEventEntry = record
Event Properties | |
Signature:LongWord;
|
Signature for entry validation |
State:LongWord;
|
State of the event (Signaled/Unsignaled) |
Flags:LongWord;
|
Event Flags (eg EVENT_FLAG_MANUAL) |
Lock:TSpinHandle;
|
Event Lock |
List:TListHandle;
|
List of threads waiting on this Event (or INVALID_HANDLE_VALUE if never used) |
Wait:TThreadWait;
|
Wait function to call to wait on the Event if it is not Signaled |
WaitEx:TThreadWaitEx;
|
Wait function to call to wait with timeout on the Event if it is not Signaled |
Release:TThreadRelease;
|
Release function to call if any threads are waiting when Event is Signaled |
Abandon:TThreadAbandon;
|
Abandon function to call if any threads are waiting when Event is destroyed |
Internal Properties | |
Prev:PEventEntry;
|
Previous entry in Event table |
Next:PEventEntry;
|
Next entry in Event table |
Statistics Properties | |
Timer list
PTimerList = ^TTimerList;
TTimerList = record
List Properties | |
Count:LongWord;
|
Count of items currently in the Timer list |
Flags:LongWord;
|
Timer list Flags (eg LOCK_FLAG_IRQ) |
Lock:TSpinHandle;
|
Timer list Lock |
First:PTimerItem;
|
First item in Timer list |
Last:PTimerItem;
|
Last item in Timer list |
Internal Properties | |
Statistics Properties | |
Timer item
PTimerItem = ^TTimerItem;
TTimerItem = record
Key:Integer;
|
Ordering key for Timer list |
Timer:TTimerHandle;
|
The timer referenced by this Timer list item |
Prev:PTimerItem;
|
Previous item in Timer list |
Next:PTimerItem;
|
Next item in Timer list |
Timer entry
PTimerEntry = ^TTimerEntry;
TTimerEntry = record
Timer Properties | |
Signature:LongWord;
|
Signature for entry validation |
Interval:LongWord;
|
Interval for timer (Milliseconds) |
State:LongWord;
|
State of the timer (Enabled/Disabled) |
Flags:LongWord;
|
Timer Flags (eg TIMER_FLAG_RESCHEDULE) |
Lock:TSpinHandle;
|
Timer Lock |
Event:TTimerEvent;
|
Function to call when timer triggers |
Data:Pointer;
|
Data to pass to function when timer triggers |
Internal Properties | |
TimerList:PTimerList;
|
The timer list this timer is currently in (or nil) |
TimerItem:TTimerItem;
|
Timer list item for this timer when in a Timer list |
Prev:PTimerEntry;
|
Previous entry in Timer table |
Next:PTimerEntry;
|
Next entry in Timer table |
Statistics Properties | |
Worker request
PWorkerRequest = ^TWorkerRequest;
TWorkerRequest = record
Worker Properties | |
Signature:LongWord;
|
Signature for entry validation |
Interval:LongWord;
|
Interval for worker (Milliseconds) |
Flags:LongWord;
|
Worker Flags (eg WORKER_FLAG_RESCHEDULE) |
Lock:TSpinHandle;
|
Worker Lock (or INVALID_HANDLE_VALUE if Interval is 0 and Flags is not WORKER_FLAG_RESCHEDULE) |
Timer:TTimerHandle;
|
Worker Timer (or INVALID_HANDLE_VALUE if Interval is 0) |
Task:TWorkerTask;
|
Task to call by worker |
Data:Pointer;
|
Data to pass to task |
Callback:TWorkerCallback;
|
Callback when task is completed |
Tasker list
PTaskerList = ^TTaskerList;
TTaskerList = record
List Properties | |
Count:LongWord;
|
Count of tasks currently in the Tasker list |
Lock:TSpinHandle;
|
Tasker list Lock |
First:PTaskerTask;
|
First task in Tasker list |
Last:PTaskerTask;
|
Last task in Tasker list |
Internal Properties | |
Statistics Properties | |
Tasker task
PTaskerTask = ^TTaskerTask;
TTaskerTask = record
Task:LongWord;
|
The task to be performed |
Prev:PTaskerTask;
|
Previous task in Tasker list |
Next:PTaskerTask;
|
Next task in Tasker list |
Tasker thread send message
PTaskerThreadSendMessage = ^TTaskerThreadSendMessage;
TTaskerThreadSendMessage = record
Task:LongWord;
|
The task to be performed |
Prev:PTaskerTask;
|
Previous task in Tasker list |
Next:PTaskerTask;
|
Next task in Tasker list |
Internal Properties | |
Thread:TThreadHandle;
|
Handle of the thread to send a message to |
Message:TMessage;
|
Message to send to the thread |
Tasker messageslot send
PTaskerMessageslotSend = ^TTaskerMessageslotSend;
TTaskerMessageslotSend = record
Task:LongWord;
|
The task to be performed |
Prev:PTaskerTask;
|
Previous task in Tasker list |
Next:PTaskerTask;
|
Next task in Tasker list |
Internal Properties | |
Messageslot:TMessageslotHandle;
|
Handle of the messageslot to send to |
Message:TMessage;
|
Message to be sent |
Tasker semaphore signal
PTaskerSemaphoreSignal = ^TTaskerSemaphoreSignal;
TTaskerSemaphoreSignal = record
Task:LongWord;
|
The task to be performed |
Prev:PTaskerTask;
|
Previous task in Tasker list |
Next:PTaskerTask;
|
Next task in Tasker list |
Internal Properties | |
Semaphore:TSemaphoreHandle;
|
Handle of the semaphore to signal |
Count:LongWord;
|
The count to be signalled |
Tasker completion reset
PTaskerCompletionReset = ^TTaskerCompletionReset;
TTaskerCompletionReset = record
Task:LongWord;
|
The task to be performed |
Prev:PTaskerTask;
|
Previous task in Tasker list |
Next:PTaskerTask;
|
Next task in Tasker list |
Internal Properties | |
Completion:TCompletionHandle;
|
Handle of the completion to reset |
Tasker completion complete
PTaskerCompletionComplete = ^TTaskerCompletionComplete;
TTaskerCompletionComplete = record
Task:LongWord;
|
The task to be performed |
Prev:PTaskerTask;
|
Previous task in Tasker list |
Next:PTaskerTask;
|
Next task in Tasker list |
Internal Properties | |
Completion:TCompletionHandle;
|
Handle of the completion to complete or complete all |
All:LongBool;
|
False for complete, True for complete all |
Thread info
PThreadInfo = ^TThreadInfo;
TThreadInfo = record
ThreadFunction:TThreadFunc;
|
|
ThreadParameter:Pointer;
|
|
StackLength:Cardinal;
|
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;
|
Mutex lock
TMutexLock = function(Mutex:PMutexEntry):LongWord;
|
Mutex unlock
TMutexUnlock = function(Mutex:PMutexEntry):LongWord;
|
Mutex try lock
TMutexTryLock = function(Mutex:PMutexEntry):LongWord;
|
Critical section lock
TCriticalSectionLock = function(CriticalSection:PCriticalSectionEntry):LongWord;
|
Critical section lock ex
TCriticalSectionLockEx = function(CriticalSection:PCriticalSectionEntry; Timeout:LongWord):LongWord;
|
Critical section unlock
TCriticalSectionUnlock = function(CriticalSection:PCriticalSectionEntry):LongWord;
|
Critical section try lock
TCriticalSectionTryLock = function(CriticalSection:PCriticalSectionEntry):LongWord;
|
Semaphore wait
TSemaphoreWait = function(Semaphore:PSemaphoreEntry):LongWord;
|
Semaphore wait ex
TSemaphoreWaitEx = function(Semaphore:PSemaphoreEntry; Timeout:LongWord):LongWord;
|
Semaphore signal
TSemaphoreSignal = function(Semaphore:PSemaphoreEntry):LongWord;
|
Synchronizer lock
TSynchronizerLock = function(Synchronizer:PSynchronizerEntry):LongWord;
|
Synchronizer lock ex
TSynchronizerLockEx = function(Synchronizer:PSynchronizerEntry; Timeout:LongWord):LongWord;
|
Synchronizer unlock
TSynchronizerUnlock = function(Synchronizer:PSynchronizerEntry):LongWord;
|
Synchronizer convert
TSynchronizerConvert = function(Synchronizer:PSynchronizerEntry):LongWord;
|
Synchronizer convert ex
TSynchronizerConvertEx = function(Synchronizer:PSynchronizerEntry; Timeout:LongWord):LongWord;
|
Condition wait
TConditionWait = function(Condition:PConditionEntry; Timeout:LongWord):LongWord;
|
Condition wait mutex
TConditionWaitMutex = function(Condition:PConditionEntry; Mutex:TMutexHandle; Timeout:LongWord):LongWord;
|
Condition wait synchronizer
TConditionWaitSynchronizer = function(Condition:PConditionEntry; Synchronizer:TSynchronizerHandle; Flags,Timeout:LongWord):LongWord;
|
Condition wait critical section
TConditionWaitCriticalSection = function(Condition:PConditionEntry; CriticalSection:TCriticalSectionHandle; Timeout:LongWord):LongWord;
|
Condition wake
TConditionWake = function(Condition:PConditionEntry):LongWord;
|
Condition wake all
TConditionWakeAll = function(Condition:PConditionEntry):LongWord;
|
Completion wait
TCompletionWait = function(Completion:PCompletionEntry; Timeout:LongWord):LongWord;
|
Completion try wait
TCompletionTryWait = function(Completion:PCompletionEntry):LongWord;
|
Completion reset
TCompletionReset = function(Completion:PCompletionEntry):LongWord;
|
Completion complete
TCompletionComplete = function(Completion:PCompletionEntry):LongWord;
|
Completion complete all
TCompletionCompleteAll = function(Completion:PCompletionEntry):LongWord;
|
Messageslot send
TMessageslotSend = function(Messageslot:PMessageslotEntry; Message:PMessage):LongWord;
|
Messageslot receive
TMessageslotReceive = function(Messageslot:PMessageslotEntry; Message:PMessage):LongWord;
|
Messageslot receive ex
TMessageslotReceiveEx = function(Messageslot:PMessageslotEntry; Message:PMessage; Timeout:LongWord):LongWord;
|
Mailslot send
TMailslotSend = function(Mailslot:PMailslotEntry; Data:PtrInt):LongWord;
|
Mailslot send ex
TMailslotSendEx = function(Mailslot:PMailslotEntry; Data:PtrInt; Timeout:LongWord):LongWord;
|
Mailslot receive
TMailslotReceive = function(Mailslot:PMailslotEntry):PtrInt;
|
Mailslot receive ex
TMailslotReceiveEx = function(Mailslot:PMailslotEntry; Timeout:LongWord):PtrInt;
|
Buffer get
TBufferGet = function(Buffer:PBufferEntry):Pointer;
|
Buffer get ex
TBufferGetEx = function(Buffer:PBufferEntry; Timeout:LongWord):Pointer;
|
Buffer free
TBufferFree = function(Buffer:Pointer):LongWord;
|
Buffer iterate
TBufferIterate = function(Buffer:PBufferEntry; Previous:Pointer):Pointer;
|
Event wait
TEventWait = function(Event:PEventEntry):LongWord;
|
Event wait ex
TEventWaitEx = function(Event:PEventEntry; Timeout:LongWord):LongWord;
|
Event set
TEventSet = function(Event:PEventEntry):LongWord;
|
Event reset
TEventReset = function(Event:PEventEntry):LongWord;
|
Event pulse
TEventPulse = function(Event:PEventEntry):LongWord;
|
Timer enable
TTimerEnable = function(Timer:PTimerEntry):LongWord;
|
Timer enable ex
TTimerEnableEx = function(Timer:PTimerEntry; Interval:LongWord; Event:TTimerEvent; Data:Pointer):LongWord;
|
Timer disable
TTimerDisable = function(Timer:PTimerEntry):LongWord;
|
Timer check
TTimerCheck = function:LongWord;
|
Timer trigger
TTimerTrigger = function:LongWord;
|
Tasker check
TTaskerCheck = function:LongWord;
|
Tasker trigger
TTaskerTrigger = function:LongWord;
|
Thread get current
TThreadGetCurrent = function:TThreadHandle;
|
Thread set current
TThreadSetCurrent = function(Thread:TThreadHandle):LongWord;
|
Thread start
TThreadStart = function(Parameter:Pointer):PtrInt;
|
Thread end
TThreadEnd = procedure(ExitCode:LongWord);
|
Scheduler check
TSchedulerCheck = function(CPUID:LongWord):LongWord;
|
Scheduler wakeup
TSchedulerWakeup = function(CPUID:LongWord):LongWord;
|
Scheduler expire
TSchedulerExpire = function(CPUID:LongWord):LongWord;
|
Scheduler switch
TSchedulerSwitch = function(CPUID:LongWord; Thread:TThreadHandle):TThreadHandle;
|
Scheduler select
TSchedulerSelect = function(CPUID:LongWord; Thread:TThreadHandle; Yield:Boolean):TThreadHandle;
|
Scheduler reschedule
TSchedulerReschedule = function (Yield:Boolean):LongWord;
|
Scheduler migration enable
TSchedulerMigrationEnable = function:LongWord;
|
Scheduler migration disable
TSchedulerMigrationDisable = function:LongWord;
|
Scheduler preempt enable
TSchedulerPreemptEnable = function(CPUID:LongWord):LongWord;
|
Scheduler preempt disable
TSchedulerPreemptDisable = function(CPUID:LongWord):LongWord;
|
Scheduler allocation enable
TSchedulerAllocationEnable = function(CPUID:LongWord):LongWord;
|
Scheduler allocation disable
TSchedulerAllocationDisable = function(CPUID:LongWord):LongWord;
|
Thread setup stack
TThreadSetupStack = function(StackBase:Pointer; StartProc:TThreadStart; ReturnProc:TThreadEnd; Parameter:Pointer):Pointer;
|
Public variables
Thread logging
THREAD_DEFAULT_LOG_LEVEL:LongWord = THREAD_LOG_LEVEL_DEBUG;
|
Minimum level for Thread messages. Only messages with level greater than or equal to this will be printed. |
THREAD_LOG_ENABLED:Boolean;
|
Scheduler variables
SchedulerThreadNext:LongWord;
|
The CPU to assign the next created thread to, round robin incremented on each create (Protected by ThreadTableLock) |
SchedulerThreadMigration:LongWord;
|
Enable or Disable thread migration (SCHEDULER_MIGRATION_DISABLED or SCHEDULER_MIGRATION_ENABLED |
SchedulerMigrationQuantum:LongWord;
|
Quantum for thread migration checks (CPU 0 only) |
SchedulerThreadCount:array of LongWord;
|
Current number of ready threads per CPU (One per CPU, allocated by scheduler initialization) (Protected by InterlockedIncrement/Decrement) |
SchedulerThreadQuantum:array of LongWord;
|
Quantum of current thread per CPU (One per CPU, allocated by scheduler initialization) |
SchedulerThreadPreempt:array of LongWord;
|
Current state of thread preemption per CPU (eg SCHEDULER_PREEMPT_DISABLED) (One per CPU, allocated by scheduler initialization) |
SchedulerThreadAllocation:array of LongWord;
|
Current state of thread allocation per CPU (eg SCHEDULER_ALLOCATION_DISABLED) (One per CPU, allocated by scheduler initialization) |
SchedulerPriorityMask:array of LongWord;
|
Mask of ready threads at each priority level (One per CPU, allocated by scheduler initialization) (Protected by InterlockedOr/And) |
SchedulerYieldCurrent:array of LongBool;
|
Scheduler yield to current priority level status (One per CPU, allocated by scheduler initialization) |
SchedulerStarvationNext:array of LongWord;
|
Scheduler starvation priority round robin (One per CPU, allocated by scheduler initialization) |
SchedulerStarvationQuantum:array of LongWord;
|
Quantum for thread starvation checks per CPU (One per CPU, allocated by scheduler initialization) |
SchedulerNoneQueue:array of TQueueHandle;
|
Queue of threads that are ready to run at priority level none (One per CPU, allocated by scheduler initialization) |
SchedulerIdleQueue:array of TQueueHandle;
|
Queue of threads that are ready to run at priority level idle (One per CPU, allocated by scheduler initialization) |
SchedulerLowestQueue:array of TQueueHandle;
|
Queue of threads that are ready to run at priority level lowest (One per CPU, allocated by scheduler initialization) |
SchedulerLowerQueue:array of TQueueHandle;
|
Queue of threads that are ready to run at priority level lower (One per CPU, allocated by scheduler initialization) |
SchedulerNormalQueue:array of TQueueHandle;
|
Queue of threads that are ready to run at priority level normal (One per CPU, allocated by scheduler initialization) |
SchedulerHigherQueue:array of TQueueHandle;
|
Queue of threads that are ready to run at priority level higher (One per CPU, allocated by scheduler initialization) |
SchedulerHighestQueue:array of TQueueHandle;
|
Queue of threads that are ready to run at priority level highest (One per CPU, allocated by scheduler initialization) |
SchedulerCriticalQueue:array of TQueueHandle;
|
Queue of threads that are ready to run at priority level critical (One per CPU, allocated by scheduler initialization) |
SchedulerSleepQueue:array of TQueueHandle;
|
Queue of threads that are currently sleeping (One per CPU, allocated by scheduler initialization) |
SchedulerTimeoutQueue:array of TQueueHandle;
|
Queue of threads that are currently waiting with a timeout (One per CPU, allocated by scheduler initialization) |
SchedulerTerminationQueue:array of TQueueHandle;
|
Queue of threads that have been terminated (One per CPU, allocated by scheduler initialization) |
SchedulerLast:array of LongWord;
|
The timer value of the last scheduler interrupt (One per CPU, allocated by scheduler initialization) |
SchedulerInterrupts:array of LongWord;
|
Current number of scheduler interrupts per CPU (When this reaches SCHEDULER_INTERRUPTS_PER_SECOND then UtilizationLast is updated and UtilizationCurrent is reset) (One per CPU, allocated by scheduler initialization) |
Scheduler debug
SchedulerInterruptCounter:array of Int64;
|
SchedulerInterruptOffset:array of LongWord;
|
SchedulerInterruptMinOffset:array of LongWord;
|
SchedulerInterruptMaxOffset:array of LongWord;
|
SchedulerInterruptRollover:array of LongWord;
|
SchedulerSelectEntry:array of Int64;
|
Number of times the scheduler select routine has been called (One per CPU) |
SchedulerSelectYield:array of Int64;
|
Number of times the scheduler select routine has been called with yield equal to true (One per CPU) |
SchedulerSelectForce:array of Int64;
|
Number of times the scheduler forced a thread switch due to starvation quantum (One per CPU) |
SchedulerSelectNoMask:array of Int64;
|
Number of times the scheduler selection encountered an empty priority mask (Should never happen)(One per CPU) |
SchedulerSelectNormal:array of Int64;
|
Number of times the scheduler selection used normal next highest priority to select thread (One per CPU) |
SchedulerSelectInvalid:array of Int64;
|
Number of times the scheduler selection resulted in INVALID_THREAD_HANDLE (Should never happen)(One per CPU) |
SchedulerSelectFailure:array of Int64;
|
Number of times the scheduler failed to enqueue the currently running thread (Should never happen)(One per CPU) |
SchedulerSelectNoReady:array of Int64;
|
Number of times the scheduler selection found no ready thread available to run (Should never happen)(One per CPU) |
SchedulerSelectDefaulted:array of Int64;
|
Number of times the scheduler selection defaulted to an IDLE or NONE thread (Should never happen)(One per CPU) |
SchedulerStarvationReset:array of Int64;
|
Number of times the scheduler reset the starvation quantum (One per CPU) |
SchedulerStarvationDecrement:array of Int64;
|
Number of times the scheduler decremented the starvation quantum (One per CPU) |
SchedulerSelectCPU:array of Int64;
|
Number of times the scheduler selection changed the CurrentCPU on a running thread (One per CPU) |
SchedulerSelectPriority:array of Int64;
|
Number of times the scheduler selection changed the Priority on a running thread (One per CPU) |
SchedulerSelectAffinity:array of Int64;
|
Number of times the scheduler selection changed the CurrentCPU on a running thread due to Affinity mismatch (One per CPU) |
SchedulerSwitchEntry:array of Int64;
|
Number of times the scheduler switch routine has been called (One per CPU) |
SchedulerSwitchThread:array of TThreadHandle;
|
The thread returned by scheduler select on the last scheduler switch call (One per CPU) |
SchedulerSwitchCounter:array of Int64;
|
Number of times the scheduler switch resulted in a thread switch (One per CPU) |
SchedulerSwitchCurrent:array of Int64;
|
Number of times the scheduler switch resulted in the current thread continuing (One per CPU) |
SchedulerSwitchInvalid:array of Int64;
|
Number of times the scheduler switch was returned INVALID_THREAD_HANDLE by scheduler select (Should never happen)(One per CPU) |
SchedulerRescheduleEntry:array of Int64;
|
Number of times the scheduler reschedule routine has been called (One per CPU) |
SchedulerRescheduleThread:array of TThreadHandle;
|
The thread returned by scheduler select on the last scheduler reschedule call (One per CPU) |
SchedulerRescheduleCounter:array of Int64;
|
Number of times the scheduler reschedule resulted in a thread switch (One per CPU) |
SchedulerRescheduleCurrent:array of Int64;
|
Number of times the scheduler reschedule resulted in the current thread continuing (One per CPU) |
SchedulerRescheduleInvalid:array of Int64;
|
Number of times the scheduler reschedule was returned INVALID_THREAD_HANDLE by scheduler select (Should never happen)(One per CPU) |
SchedulerMigrationCounter:Int64;
|
Number of times scheduler select invoked a thread migration (CPU 0 only) |
SchedulerTerminationCounter:array of Int64;
|
Number of threads destroyed by scheduler reschedule (After termination quantum)(One per CPU) |
SchedulerSecondaryWaitCounter:array of Int64;
|
Number of wait cycles performed by secondary CPUs while waiting for init completion (One per CPU) |
Lock debug
SpinDeadlockCounter:Int64;
|
SpinRecursionCounter:Int64;
|
SpinRecursionThread:TThreadHandle;
|
SpinIRQThreadCounter:Int64;
|
SpinFIQThreadCounter:Int64;
|
SpinSWIThreadCounter:Int64;
|
SpinIdleThreadCounter:Int64;
|
MutexDeadlockCounter:Int64;
|
MutexRecursionCounter:Int64;
|
MutexRecursionThread:TThreadHandle;
|
MutexIRQThreadCounter:Int64;
|
MutexFIQThreadCounter:Int64;
|
MutexSWIThreadCounter:Int64;
|
MutexIdleThreadCounter:Int64;
|
CriticalSectionDeadlockCounter:Int64;
|
SemaphoreDeadlockCounter:Int64;
|
SynchronizerDeadlockCounter:Int64;
|
SynchronizerRecursionCounter:Int64;
|
ConditionDeadlockCounter:Int64;
|
CompletionDeadlockCounter:Int64;
|
MessageslotDeadlockCounter:Int64;
|
MailslotDeadlockCounter:Int64;
|
BufferDeadlockCounter:Int64;
|
EventDeadlockCounter:Int64;
|
Spin debug
SpinLockEntry:LongWord;
|
SpinUnlockEntry:LongWord;
|
SpinLockExit:LongWord;
|
SpinUnlockExit:LongWord;
|
SpinUnlockNoLock:LongWord;
|
SpinUnlockNoOwner:LongWord;
|
SpinLockCounter:LongWord;
|
SpinUnlockCounter:LongWord;
|
SpinDestroyCounter:LongWord;
|
SpinLockIRQCounter:LongWord;
|
SpinUnlockIRQCounter:LongWord;
|
SpinLockFIQCounter:LongWord;
|
SpinUnlockFIQCounter:LongWord;
|
SpinLockIRQFIQCounter:LongWord;
|
SpinUnlockIRQFIQCounter:LongWord;
|
Mutex debug
MutexLockEntry:LongWord;
|
MutexUnlockEntry:LongWord;
|
MutexLockExit:LongWord;
|
MutexUnlockExit:LongWord;
|
MutexUnlockNoLock:LongWord;
|
MutexUnlockNoOwner:LongWord;
|
MutexLockCounter:LongWord;
|
MutexUnlockCounter:LongWord;
|
MutexDestroyCounter:LongWord;
|
Heap manager variables
HeapLock:THeapLock;
|
RTL thread manager variables
ThreadVarBlockSize:DWORD;
|
Initialization handlers
PrimaryInitHandler:TPrimaryInit;
|
SchedulerInitHandler:TSchedulerInit;
|
SchedulerStartHandler:TSchedulerStart;
|
SecondaryInitHandler:TSecondaryInit;
|
SecondaryBootHandler:TSecondaryBoot;
|
SpinLock/Unlock handlers
SpinLockHandler:TSpinLock;
|
SpinUnlockHandler:TSpinUnlock;
|
SpinLockIRQHandler:TSpinLockIRQ;
|
SpinUnlockIRQHandler:TSpinUnlockIRQ;
|
SpinLockFIQHandler:TSpinLockFIQ;
|
SpinUnlockFIQHandler:TSpinUnlockFIQ;
|
SpinLockIRQFIQHandler:TSpinLockIRQFIQ;
|
SpinUnlockIRQFIQHandler:TSpinUnlockIRQFIQ;
|
SpinCheckIRQHandler:TSpinCheckIRQ;
|
SpinCheckFIQHandler:TSpinCheckFIQ;
|
SpinExchangeIRQHandler:TSpinExchangeIRQ;
|
SpinExchangeFIQHandler:TSpinExchangeFIQ;
|
SpinMaskExchangeHandler:TSpinMaskExchange;
|
MutexLock/Unlock handlers
MutexLockHandler:TMutexLock;
|
MutexUnlockHandler:TMutexUnlock;
|
MutexTryLockHandler:TMutexTryLock;
|
CriticalSection Lock/Unlock/TryLock handlers
CriticalSectionLockHandler:TCriticalSectionLock;
|
CriticalSectionLockExHandler:TCriticalSectionLockEx;
|
CriticalSectionUnlockHandler:TCriticalSectionUnlock;
|
CriticalSectionTryLockHandler:TCriticalSectionTryLock;
|
Semaphore Wait/Signal handlers
SemaphoreWaitHandler:TSemaphoreWait;
|
SemaphoreWaitExHandler:TSemaphoreWaitEx;
|
SemaphoreSignalHandler:TSemaphoreSignal;
|
Synchronizer Reader/WriterLock/Unlock handlers
SynchronizerReaderLockHandler:TSynchronizerLock;
|
SynchronizerWriterLockHandler:TSynchronizerLock;
|
SynchronizerReaderLockExHandler:TSynchronizerLockEx;
|
SynchronizerWriterLockExHandler:TSynchronizerLockEx;
|
SynchronizerReaderUnlockHandler:TSynchronizerUnlock;
|
SynchronizerWriterUnlockHandler:TSynchronizerUnlock;
|
SynchronizerReaderConvertHandler:TSynchronizerConvert;
|
SynchronizerWriterConvertHandler:TSynchronizerConvert;
|
SynchronizerReaderConvertExHandler:TSynchronizerConvertEx;
|
Condition Wait/Wake/WakeAll Handlers
ConditionWaitHandler:TConditionWait;
|
ConditionWaitMutexHandler:TConditionWaitMutex;
|
ConditionWaitSynchronizerHandler:TConditionWaitSynchronizer;
|
ConditionWaitCriticalSectionHandler:TConditionWaitCriticalSection;
|
ConditionWakeHandler:TConditionWake;
|
ConditionWakeAllHandler:TConditionWakeAll;
|
Completion Wait/TryWait/Reset/Complete/CompleteAll Handlers
CompletionWaitHandler:TCompletionWait;
|
CompletionTryWaitHandler:TCompletionTryWait;
|
CompletionResetHandler:TCompletionReset;
|
CompletionCompleteHandler:TCompletionComplete;
|
CompletionCompleteAllHandler:TCompletionCompleteAll;
|
Messageslot send and receive handlers
MessageslotSendHandler:TMessageslotSend;
|
MessageslotReceiveHandler:TMessageslotReceive;
|
MessageslotReceiveExHandler:TMessageslotReceiveEx;
|
Mailslot send and receive handlers
MailslotSendHandler:TMailslotSend;
|
MailslotSendExHandler:TMailslotSendEx;
|
MailslotReceiveHandler:TMailslotReceive;
|
MailslotReceiveExHandler:TMailslotReceiveEx;
|
Buffer Get/GetEx/Free handlers
BufferGetHandler:TBufferGet;
|
BufferGetExHandler:TBufferGetEx;
|
BufferFreeHandler:TBufferFree;
|
BufferIterateHandler:TBufferIterate;
|
Event Wait/Set/Reset/Pulse handlers
EventWaitHandler:TEventWait;
|
EventWaitExHandler:TEventWaitEx;
|
EventSetHandler:TEventSet;
|
EventResetHandler:TEventReset;
|
EventPulseHandler:TEventPulse;
|
Timer Enable/Disable/Check/Trigger handlers
TimerEnableHandler:TTimerEnable;
|
TimerEnableExHandler:TTimerEnableEx;
|
TimerDisableHandler:TTimerDisable;
|
TimerCheckHandler:TTimerCheck;
|
TimerTriggerHandler:TTimerTrigger;
|
Tasker Check/Trigger handlers
TaskerCheckHandler:TTaskerCheck;
|
TaskerTriggerHandler:TTaskerTrigger;
|
Thread Get/SetCurrent handlers
ThreadGetCurrentHandler:TThreadGetCurrent;
|
ThreadSetCurrentHandler:TThreadSetCurrent;
|
Scheduler Check/Wakeup/Expire/Select/Switch handlers
SchedulerCheckHandler:TSchedulerCheck;
|
SchedulerWakeupHandler:TSchedulerWakeup;
|
SchedulerExpireHandler:TSchedulerExpire;
|
SchedulerSwitchHandler:TSchedulerSwitch;
|
SchedulerSelectHandler:TSchedulerSelect;
|
SchedulerRescheduleHandler:TSchedulerReschedule;
|
SchedulerMigrationEnableHandler:TSchedulerMigrationEnable;
|
SchedulerMigrationDisableHandler:TSchedulerMigrationDisable;
|
SchedulerPreemptEnableHandler:TSchedulerPreemptEnable;
|
SchedulerPreemptDisableHandler:TSchedulerPreemptDisable;
|
SchedulerAllocationEnableHandler:TSchedulerAllocationEnable;
|
SchedulerAllocationDisableHandler:TSchedulerAllocationDisable;
|
Thread SetupStack handlers
ThreadSetupStackHandler:TThreadSetupStack;
|
Function declarations
Initialization functions
procedure LocksInit;
Note | Called only during system startup |
---|
procedure ThreadsInit;
Note | Called only during system startup |
---|
procedure PrimaryInit;
Note | Called only during system startup |
---|
procedure SchedulerInit;
Note | Called only during system startup |
---|
procedure SchedulerStart(CPUID:LongWord);
Note | Called only during system startup |
---|
procedure SecondaryInit;
Note | Called only during system startup |
---|
procedure SecondaryBoot(CPUID:LongWord);
Note | Called only during system startup |
---|
procedure SecondaryStart(CPUID:LongWord);
Note | The Secondary Boot procedure should have already cleared L1 cache, enabled FPU, MMU, Vectors and PageTables before calling this function. The thread Id of the IRQ or FIQ should also have been loaded into the appropriate registers.
Called only during system startup. |
---|
function IRQExecute(Parameter:Pointer):PtrInt;
Note | Not intended to be called directly by applications |
---|
function FIQExecute(Parameter:Pointer):PtrInt;
Note | Not intended to be called directly by applications |
---|
function SWIExecute(Parameter:Pointer):PtrInt;
Note | Not intended to be called directly by applications |
---|
function IdleExecute(Parameter:Pointer):PtrInt;
Note | Not intended to be called directly by applications |
---|
function MainExecute(Parameter:Pointer):PtrInt;
Note | Not intended to be called directly by applications |
---|
function TimerExecute(Parameter:Pointer):PtrInt;
Note | Not intended to be called directly by applications |
---|
function WorkerExecute(Parameter:Pointer):PtrInt;
Note | Not intended to be called directly by applications |
---|
function TimerPriorityExecute(Parameter:Pointer):PtrInt;
Note | Not intended to be called directly by applications |
---|
function WorkerPriorityExecute(Parameter:Pointer):PtrInt;
Note | Not intended to be called directly by applications |
---|
function IdleCalibrate:LongWord;
Note | Called only during system startup |
---|
Spin functions
function SpinCreate:TSpinHandle;
Return | Handle of new Spin entry or INVALID_HANDLE_VALUE if entry could not be created |
---|
function SpinCreateEx(InitialOwner:Boolean):TSpinHandle;
InitialOwner | If true set the state of the spin to locked and the owner to the current thread |
---|---|
Return | Handle of new Spin entry or INVALID_HANDLE_VALUE if entry could not be created |
function SpinDestroy(Spin:TSpinHandle):LongWord;
Spin | Handle of Spin entry to destroy |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function SpinOwner(Spin:TSpinHandle):TThreadHandle;
Spin | Handle of Spin entry to get owner for |
---|---|
Return | Handle of owning thread or INVALID_HANDLE_VALUE if not currently owned |
function SpinLock(Spin:TSpinHandle):LongWord;
Spin | Handle of Spin entry to lock |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function SpinUnlock(Spin:TSpinHandle):LongWord;
Spin | Handle of Spin entry to unlock |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function SpinLockIRQ(Spin:TSpinHandle):LongWord;
Spin | Handle of Spin entry to lock |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function SpinUnlockIRQ(Spin:TSpinHandle):LongWord;
Spin | Handle of Spin entry to unlock |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function SpinLockFIQ(Spin:TSpinHandle):LongWord;
Spin | Handle of Spin entry to lock |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function SpinUnlockFIQ(Spin:TSpinHandle):LongWord;
Spin | Handle of Spin entry to unlock |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function SpinLockIRQFIQ(Spin:TSpinHandle):LongWord;
Spin | Handle of Spin entry to lock |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function SpinUnlockIRQFIQ(Spin:TSpinHandle):LongWord;
Spin | Handle of Spin entry to unlock |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function SpinLockPreempt(Spin:TSpinHandle):LongWord;
Spin | Handle of Spin entry to lock |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | This is a convenience wrapper which determines the appropriate SpinLock call to disable preemption |
function SpinUnlockPreempt(Spin:TSpinHandle):LongWord;
Spin | Handle of Spin entry to unlock |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | This is a convenience wrapper which determines the appropriate SpinUnlock call to enable preemption |
function SpinCheckIRQ(Spin:TSpinHandle):Boolean;
Spin | Handle of Spin entry to check |
---|---|
Return | True if the mask would enable IRQ on restore, False if it would not |
Note | The Spin entry must be locked by the current thread |
function SpinCheckFIQ(Spin:TSpinHandle):Boolean;
Spin | Handle of Spin entry to check |
---|---|
Return | True if the mask would enable FIQ on restore, False if it would not |
Note | The Spin entry must be locked by the current thread |
function SpinExchangeIRQ(Spin1,Spin2:TSpinHandle):LongWord;
Spin1 | Handle of first Spin entry |
---|---|
Spin2 | Handle of second Spin entry |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | Both Spin entries must be locked by the current thread |
function SpinExchangeFIQ(Spin1,Spin2:TSpinHandle):LongWord;
Spin1 | Handle of first Spin entry |
---|---|
Spin2 | Handle of second Spin entry |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | Both Spin entries must be locked by the current thread |
function SpinLockDefault(SpinEntry:PSpinEntry):LongWord;
Note | Not intended to be called directly by applications, use SpinLock instead |
---|
function SpinUnlockDefault(SpinEntry:PSpinEntry):LongWord;
Note | Not intended to be called directly by applications, use SpinUnlock instead |
---|
function SpinLockIRQDefault(SpinEntry:PSpinEntry):LongWord;
Note | Not intended to be called directly by applications, use SpinLockIRQ instead |
---|
function SpinUnlockIRQDefault(SpinEntry:PSpinEntry):LongWord;
Note | Not intended to be called directly by applications, use SpinUnlockIRQ instead |
---|
function SpinLockFIQDefault(SpinEntry:PSpinEntry):LongWord;
Note | Not intended to be called directly by applications, use SpinLockFIQ instead |
---|
function SpinUnlockFIQDefault(SpinEntry:PSpinEntry):LongWord;
Note | Not intended to be called directly by applications, use SpinUnlockFIQ instead |
---|
function SpinLockIRQFIQDefault(SpinEntry:PSpinEntry):LongWord;
Note | Not intended to be called directly by applications, use SpinLockIRQFIQ instead |
---|
function SpinUnlockIRQFIQDefault(SpinEntry:PSpinEntry):LongWord;
Note | Not intended to be called directly by applications, use SpinUnlockIRQFIQ instead |
---|
Mutex functions
function MutexCreate:TMutexHandle;
Return | Handle of new Mutex entry or INVALID_HANDLE_VALUE if entry could not be created |
---|
function MutexCreateEx(InitialOwner:Boolean; SpinCount:LongWord; Flags:LongWord):TMutexHandle;
InitialOwner | If true set the state of the mutex to locked and the owner to the current thread |
---|---|
SpinCount | The number of times the mutex will spin before yielding (Always 0 if CPU count equals 1) |
Flags | The flags for the Mutex entry (eg MUTEX_FLAG_RECURSIVE) |
Return | Handle of new Mutex entry or INVALID_HANDLE_VALUE if entry could not be created |
function MutexDestroy(Mutex:TMutexHandle):LongWord;
Mutex | Handle of Mutex entry to destroy |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function MutexFlags(Mutex:TMutexHandle):LongWord;
Mutex | Handle of Mutex entry to get flags for |
---|---|
Return | Current flags or INVALID_HANDLE_VALUE on error |
function MutexCount(Mutex:TMutexHandle):LongWord;
Mutex | Mutex to get count for |
---|---|
Return | Current lock count or INVALID_HANDLE_VALUE on error |
Note | Count is only valid if Flags includes MUTEX_FLAG_RECURSIVE |
function MutexOwner(Mutex:TMutexHandle):TThreadHandle;
Mutex | Handle of Mutex entry to get owner for |
---|---|
Return | Handle of owning thread or INVALID_HANDLE_VALUE if not currently owned |
function MutexLock(Mutex:TMutexHandle):LongWord;
Mutex | Handle of Mutex entry to lock |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function MutexUnlock(Mutex:TMutexHandle):LongWord;
Mutex | Handle of Mutex entry to unlock |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function MutexTryLock(Mutex:TMutexHandle):LongWord;
Mutex | Mutex to try to lock |
---|---|
Return | ERROR_SUCCESS if completed, ERROR_LOCKED if already locked or another error code on failure |
function MutexLockDefault(MutexEntry:PMutexEntry):LongWord;
Note | Not intended to be called directly by applications, use MutexLock instead |
---|
function MutexUnlockDefault(MutexEntry:PMutexEntry):LongWord;
Note | Not intended to be called directly by applications, use MutexUnlock instead |
---|
function MutexTryLockDefault(MutexEntry:PMutexEntry):LongWord;
Note | Not intended to be called directly by applications, use MutexTryLock instead |
---|
Critical section functions
function CriticalSectionCreate:TCriticalSectionHandle;
Return | Handle of new CriticalSection entry or INVALID_HANDLE_VALUE if entry could not be created |
---|
function CriticalSectionCreateEx(InitialOwner:Boolean; SpinCount:LongWord):TCriticalSectionHandle;
CriticalSection | If true set the state of the criticalsection to locked and the owner to the current thread |
---|---|
SpinCount | The number of times the criticalsection will spin before waiting (Always 0 if CPU count equals 1) |
Return | Handle of new CriticalSection entry or INVALID_HANDLE_VALUE if entry could not be created |
function CriticalSectionDestroy(CriticalSection:TCriticalSectionHandle):LongWord;
CriticalSection | Handle of CriticalSection entry to destroy |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function CriticalSectionCount(CriticalSection:TCriticalSectionHandle):LongWord;
CriticalSection | CriticalSection to get count for |
---|---|
Return | Current lock count or INVALID_HANDLE_VALUE on error |
function CriticalSectionOwner(CriticalSection:TCriticalSectionHandle):TThreadHandle;
CriticalSection | CriticalSection to get owner for |
---|---|
Return | Handle of owning thread or INVALID_HANDLE_VALUE if not currently owned |
function CriticalSectionSetSpinCount(CriticalSection:TCriticalSectionHandle; SpinCount:LongWord):LongWord;
CriticalSection | CriticalSection to set spin count for |
---|---|
SpinCount | The spin count value to set |
Return | Current spin count or INVALID_HANDLE_VALUE on error |
function CriticalSectionLock(CriticalSection:TCriticalSectionHandle):LongWord;
CriticalSection | CriticalSection to lock |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | If the CriticalSection is not locked then lock it, set the count to one and mark the owner as the current thread. If the CriticalSection is already locked by the current thread then increment the count and return immediately. If the CriticalSection is already locked by another thread then wait until it is unlocked. |
function CriticalSectionLockEx(CriticalSection:TCriticalSectionHandle; Timeout:LongWord):LongWord;
CriticalSection | CriticalSection to lock |
---|---|
Timeout | Milliseconds to wait before timeout (0 equals do not wait, INFINITE equals wait forever) |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | If the CriticalSection is not locked then lock it, set the count to one and mark the owner as the current thread. If the CriticalSection is already locked by the current thread then increment the count and return immediately. If the CriticalSection is already locked by another thread then wait until it is unlocked. |
function CriticalSectionUnlock(CriticalSection:TCriticalSectionHandle):LongWord;
CriticalSection | CriticalSection to unlock |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | If the CriticalSection is locked by the current thread then decrement the count. If the count is greater than zero then return immediately. If the count reaches zero then unlock the CriticalSection and release the first thread waiting for it to be unlocked. If the CriticalSection is locked by another thread then return an error. If the CriticalSection is not locked then return an error. |
function CriticalSectionTryLock(CriticalSection:TCriticalSectionHandle):LongWord;
CriticalSection | CriticalSection to try to lock |
---|---|
Return | ERROR_SUCCESS if completed, ERROR_LOCKED if locked by another thread or another error code on failure |
Note | If the CriticalSection is not locked then lock it, set the count to one and mark the owner as the current thread. If the CriticalSection is already locked by the current thread then increment the count and return immediately. If the CriticalSection is already locked by another thread then return immediately with an error and do not wait for it to be unlocked. |
Semaphore functions
function SemaphoreCreate(Count:LongWord):TSemaphoreHandle;
Count | The initial count of the Semaphore (Must be greater than or equal to zero) |
---|---|
Return | Handle of new Semaphore entry or INVALID_HANDLE_VALUE if entry could not be created |
function SemaphoreCreateEx(Count,Maximum:LongWord; Flags:LongWord):TSemaphoreHandle;
Count | The initial count of the Semaphore (Must be greater than or equal to zero) |
---|---|
Maximum | The maximum count of the Semaphore (Must be greater than one) |
Flags | The flags for the Semaphore entry (eg SEMAPHORE_FLAG_IRQ) |
Return | Handle of new Semaphore entry or INVALID_HANDLE_VALUE if entry could not be created |
function SemaphoreDestroy(Semaphore:TSemaphoreHandle):LongWord;
Semaphore | Handle of Semaphore entry to destroy |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function SemaphoreCount(Semaphore:TSemaphoreHandle):LongWord;
Semaphore | Semaphore to get count for |
---|---|
Return | Current count or INVALID_HANDLE_VALUE on error |
function SemaphoreWait(Semaphore:TSemaphoreHandle):LongWord;
Semaphore | Semaphore to wait on |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | If the Semaphore count is greater than zero it will be decremented and this function will return immediately. If the Semaphore count is zero the current thread will be put on a wait queue until the Semaphore is signalled by another thread calling SemaphoreSignal() or SemaphoreSignalEx(). |
function SemaphoreWaitEx(Semaphore:TSemaphoreHandle; Timeout:LongWord):LongWord;
Semaphore | Semaphore to wait on |
---|---|
Timeout | Milliseconds to wait before timeout (0 equals do not wait, INFINITE equals wait forever) |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | If the Semaphore count is greater than zero it will be decremented and this function will return immediately. If the Semaphore count is zero the current thread will be put on a wait queue until the Semaphore is signalled by another thread calling SemaphoreSignal() or SemaphoreSignalEx(). |
function SemaphoreSignal(Semaphore:TSemaphoreHandle):LongWord;
Semaphore | Semaphore to signal |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | If any threads are waiting on the Semaphore then one thread will be woken up and placed on the ready queue. If no threads are waiting then the Semaphore count will be incremented by one. |
function SemaphoreSignalEx(Semaphore:TSemaphoreHandle; Count:LongWord; Previous:PLongWord):LongWord;
Semaphore | Semaphore to signal |
---|---|
Count | The number is times to signal the Semaphore, must be greater than zero. |
Previous | A pointer to a value that receives the previous count of the Semaphore. Can be nil if the previous count is not required. |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | If any threads are waiting on the Semaphore then one thread will be woken up and placed on the ready queue for each iteration of the count passed. If no threads are waiting then the Semaphore count will be incremented once for each iteration of the count passed. |
Synchronizer functions
function SynchronizerCreate:TSynchronizerHandle;
Return | Handle of new Synchronizer entry or INVALID_HANDLE_VALUE if entry could not be created |
---|
function SynchronizerCreateEx(InitialReader,InitialWriter:Boolean):TSynchronizerHandle;
InitialReader | If true set the state of the synchronizer to locked and the reader count to 1 |
---|---|
InitialWriter | If true set the state of the synchronizer to locked and the writer owner to the current thread |
Return | Handle of new Synchronizer entry or INVALID_HANDLE_VALUE if entry could not be created |
function SynchronizerDestroy(Synchronizer:TSynchronizerHandle):LongWord;
Synchronizer | Handle of Synchronizer entry to destroy |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function SynchronizerReaderCount(Synchronizer:TSynchronizerHandle):LongWord;
Synchronizer | Synchronizer to get count for |
---|---|
Return | Current reader count or INVALID_HANDLE_VALUE on error |
function SynchronizerReaderLast(Synchronizer:TSynchronizerHandle):TThreadHandle;
Synchronizer | Synchronizer to last reader for |
---|---|
Return | Last reader thread or INVALID_HANDLE_VALUE on error |
function SynchronizerReaderLock(Synchronizer:TSynchronizerHandle):LongWord;
Synchronizer | Synchronizer to lock |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | If the Synchronizer is not locked then lock it and set the reader count to one. If the Synchronizer is already locked for reading then increment the reader count and return immediately. If the Synchronizer is already locked for writing then wait until it is unlocked. |
function SynchronizerReaderLockEx(Synchronizer:TSynchronizerHandle; Timeout:LongWord):LongWord;
Synchronizer | Synchronizer to lock |
---|---|
Timeout | Milliseconds to wait before timeout (0 equals do not wait, INFINITE equals wait forever) |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | If the Synchronizer is not locked then lock it and set the reader count to one. If the Synchronizer is already locked for reading then increment the reader count and return immediately. If the Synchronizer is already locked for writing then wait until it is unlocked. |
function SynchronizerReaderUnlock(Synchronizer:TSynchronizerHandle):LongWord;
Synchronizer | Synchronizer to unlock |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | If the Synchronizer is locked for reading then decrement the count. If the count is greater than zero then return immediately. If the count reaches zero then unlock the Synchronizer and release the first writer thread waiting for it to be unlocked. If the Synchronizer is locked for writing then return an error. If the Synchronizer is not locked then return an error. |
function SynchronizerReaderConvert(Synchronizer:TSynchronizerHandle):LongWord;
Synchronizer | Synchronizer to convert |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | If the Synchronizer is locked for reading then decrement the count. If the count is greater than zero then wait to acquire the writer lock. If the count reaches zero then convert to writer lock with the current thread as the owner. If the Synchronizer is locked for writing then return an error. If the Synchronizer is not locked then return an error. Since reader locks are recursive but do not maintain reader thread ownership, caller must ensure that one and only one reader lock is held by the current thread. |
function SynchronizerReaderConvertEx(Synchronizer:TSynchronizerHandle; Timeout:LongWord):LongWord;
Synchronizer | Synchronizer to convert |
---|---|
Timeout | Milliseconds to wait before timeout (0 equals do not wait, INFINITE equals wait forever) |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | If the Synchronizer is locked for reading then decrement the count. If the count is greater than zero then wait to acquire the writer lock. If the count reaches zero then convert to writer lock with the current thread as the owner. If the Synchronizer is locked for writing then return an error. If the Synchronizer is not locked then return an error. Since reader locks are recursive but do not maintain reader thread ownership, caller must ensure that one and only one reader lock is held by the current thread. |
function SynchronizerWriterCount(Synchronizer:TSynchronizerHandle):LongWord;
Synchronizer | Synchronizer to get count for |
---|---|
Return | Current writer count or INVALID_HANDLE_VALUE on error |
function SynchronizerWriterOwner(Synchronizer:TSynchronizerHandle):TThreadHandle;
Synchronizer | Synchronizer to get owner for |
---|---|
Return | Handle of owning thread or INVALID_HANDLE_VALUE if not currently owned |
function SynchronizerWriterLock(Synchronizer:TSynchronizerHandle):LongWord;
Synchronizer | Synchronizer to lock |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | If the Synchronizer is not locked then lock it, set the writer count to one and mark the owner as the current thread. If the Synchronizer is already locked by the current thread then increment the writer count and return immediately. If the Synchronizer is already locked for reading then wait until it is unlocked. |
function SynchronizerWriterLockEx(Synchronizer:TSynchronizerHandle; Timeout:LongWord):LongWord;
Synchronizer | Synchronizer to lock |
---|---|
Timeout | Milliseconds to wait before timeout (0 equals do not wait, INFINITE equals wait forever) |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | If the Synchronizer is not locked then lock it, set the writer count to one and mark the owner as the current thread. If the Synchronizer is already locked by the current thread then increment the writer count and return immediately. If the Synchronizer is already locked for reading then wait until it is unlocked. |
function SynchronizerWriterUnlock(Synchronizer:TSynchronizerHandle):LongWord;
Synchronizer | Synchronizer to unlock |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | If the Synchronizer is locked for writing by the current thread then decrement the count. If the count is greater than zero then return immediately. If the count reaches zero then unlock the Synchronizer and release all reader threads waiting for it to be unlocked or the first writer thread waiting for it to be unlocked. If the Synchronizer is locked for reading then return an error. If the Synchronizer is locked for writing by another thread then return an error. If the Synchronizer is not locked then return an error. |
function SynchronizerWriterConvert(Synchronizer:TSynchronizerHandle):LongWord;
Synchronizer | Synchronizer to convert |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | If the Synchronizer is locked for writing by the current thread and the count is one then decrement the count. If the count is greater than one then return an error. If the count reaches zero then convert to reader lock and release all waiting reader threads. If the Synchronizer is locked for reading then return an error. If the Synchronizer is not locked then return an error. Since writer locks are recursive, caller must ensure that one and only one writer lock is held by the current thread. |
Condition functions
function ConditionCreate:TConditionHandle;
Return | Handle of new Condition entry or INVALID_HANDLE_VALUE if entry could not be created |
---|
function ConditionDestroy(Condition:TConditionHandle):LongWord;
Condition | Handle of Condition entry to destroy |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function ConditionWait(Condition:TConditionHandle; Timeout:LongWord = INFINITE):LongWord;
Condition | Condition to wait on |
---|---|
Timeout | Time in milliseconds to wait to be woken
0 = No Wait
|
Return | ERROR_SUCCESS if completed or another error code on failure |
function ConditionWaitMutex(Condition:TConditionHandle; Mutex:TMutexHandle; Timeout:LongWord = INFINITE):LongWord;
Condition | Condition to wait on |
---|---|
Mutex | Mutex to release |
Timeout | Time in milliseconds to wait to be woken
0 = No Wait
|
Return | ERROR_SUCCESS if completed or another error code on failure.
Before returning (with either success or failure) the thread will reacquire the Mutex. |
Note | Caller must be the owner of the Mutex with a count of one on entry to this function |
function ConditionWaitSynchronizer(Condition:TConditionHandle; Synchronizer:TSynchronizerHandle; Flags:LongWord; Timeout:LongWord = INFINITE):LongWord;
Condition | Condition to wait on |
---|---|
Synchronizer | Synchronizer to release |
Flags | Flags to indicate reader or writer lock for the Synchronizer (eg CONDITION_LOCK_FLAG_WRITER) |
Timeout | Time in milliseconds to wait to be woken
0 = No Wait
|
Return | ERROR_SUCCESS if completed or another error code on failure.
Before returning (with either success or failure) the thread will reacquire the Synchronizer for either reading or writing depending on the flags value. |
Note | Caller must be the owner of the Synchronizer with a count of one on entry to this function and the ownership must match the flags value provided. |
function ConditionWaitCriticalSection(Condition:TConditionHandle; CriticalSection:TCriticalSectionHandle; Timeout:LongWord = INFINITE):LongWord;
Condition | Condition to wait on |
---|---|
CriticalSection | Critical Section to release |
Timeout | Time in milliseconds to wait to be woken
0 = No Wait
|
Return | ERROR_SUCCESS if completed or another error code on failure.
Before returning (with either success or failure) the thread will reacquire the Synchronizer for either reading or writing depending on the flags value. |
Note | Caller must be the owner of the Critical Section with a count of one on entry to this function. |
function ConditionWake(Condition:TConditionHandle):LongWord;
Condition | Condition to wake |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function ConditionWakeAll(Condition:TConditionHandle):LongWord;
Condition | Condition to wake |
---|---|
Note | ERROR_SUCCESS if completed or another error code on failure |
Completion functions
function CompletionLock(Completion:PCompletionEntry):LongWord;
Return | ERROR_SUCCESS if completed or another error code on failure |
---|---|
Note | Not intended to be called directly by applications |
function CompletionUnlock(Completion:PCompletionEntry):LongWord;
Return | ERROR_SUCCESS if completed or another error code on failure |
---|---|
Note | Not intended to be called directly by applications |
function CompletionCreate(Flags:LongWord = COMPLETION_FLAG_NONE):TCompletionHandle;
Flags | The flags for the Completion entry (eg COMPLETION_FLAG_IRQ) |
---|---|
Return | Handle of new Completion entry or INVALID_HANDLE_VALUE if entry could not be created |
function CompletionDestroy(Completion:TCompletionHandle):LongWord;
Completion | Handle of Completion entry to destroy |
---|---|
Destroy | ERROR_SUCCESS if completed or another error code on failure |
function CompletionState(Completion:TCompletionHandle):LongWord;
Completion | Completion to get the state for |
---|---|
Return | Current state (eg COMPLETION_STATE_COMPLETE) or INVALID_HANDLE_VALUE on error |
function CompletionWait(Completion:TCompletionHandle; Timeout:LongWord = INFINITE):LongWord;
Completion | Completion to wait on |
---|---|
Timeout | Time in milliseconds to wait to be woken
0 = No Wait
|
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | If the completion is set (complete) then return immediately with success. If the completion is not set then wait for it to be completed before returning. For counted completions, decrement the count if it is not 0 or -1 after testing if the completion is set. |
function CompletionTryWait(Completion:TCompletionHandle):LongWord;
Completion | Completion to try |
---|---|
Return | ERROR_SUCCESS if completed, ERROR_NOT_READY if not completed or another error code on failure |
Note | If the completion is not set (complete) then return immediately with an error and do not wait for it to be completed. |
function CompletionReset(Completion:TCompletionHandle):LongWord;
Completion | Completion to reset the state for |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | If the completion is not set then return with no action. If the completion is set then change the state to not set. For counted completions, reset the counter to 0. |
function CompletionComplete(Completion:TCompletionHandle):LongWord;
Completion | Completion to set the state for |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | If the completion is already set then return with no action. If the completion is not set then release one waiting thread (if any) and return. For counted completions, release one waiting thread, if there are no waiting threads increment the count if it is not -1 and return. |
function CompletionCompleteAll(Completion:TCompletionHandle):LongWord;
Completion | Completion to set the state for |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | If the completion is already set then return with no action. If the completion is not set then release all waiting threads (if any) and return. For counted completions, set the count to -1, release all waiting threads (if any) and return. |
List functions
function ListCreate:TListHandle;
Return | Handle of new List entry or INVALID_HANDLE_VALUE if entry could not be created |
---|
function ListCreateEx(ListType:LongWord; Flags:LongWord):TListHandle;
ListType | Type of list to create (eg LIST_TYPE_WAIT_SEMAPHORE) |
---|---|
Flags | Flags for the new list (eg LIST_FLAG_IRQ) |
Return | Handle of new List entry or INVALID_HANDLE_VALUE if entry could not be created |
function ListDestroy(List:TListHandle):LongWord;
List | Handle of List entry to destroy |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | If list is part of a synchronisation object then caller must hold the lock on the object containing the list |
function ListCount(List:TListHandle):LongWord;
List | Handle of List entry to get from |
---|---|
Return | List count on success or INVALID_HANDLE_VALUE on failure |
function ListAddFirst(List:TListHandle; Element:PListElement):LongWord;
List | Handle of List entry to add to |
---|---|
Element | The list element to be added |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | If list is part of a synchronisation object then caller must hold the lock on the object containing the list |
function ListAddLast(List:TListHandle; Element:PListElement):LongWord;
List | Handle of List entry to add to |
---|---|
Element | The list element to be added |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | If list is part of a synchronisation object then caller must hold the lock on the object containing the list |
function ListGetThread(List:TListHandle; Thread:TThreadHandle):PListElement;
List | Handle of List entry to find from |
---|---|
Thread | The thread handle to be found |
Return | List element on success, nil on failure or list empty |
Note | If list is part of a synchronisation object then caller must hold the lock on the object containing the list |
function ListGetFirst(List:TListHandle):PListElement;
List | Handle of List entry to get from |
---|---|
Return | List element on success, nil on failure or list empty |
Note | If list is part of a synchronisation object then caller must hold the lock on the object containing the list |
function ListGetFirstEx(List:TListHandle; Remove:Boolean):PListElement;
List | Handle of List entry to get from |
---|---|
Remove | If true then remove the element from the list |
Return | List element on success, nil on failure or list empty |
Note | If list is part of a synchronisation object then caller must hold the lock on the object containing the list |
function ListGetLast(List:TListHandle):PListElement;
List | Handle of List entry to get from |
---|---|
Return | List element on success, nil on failure or list empty |
Note | If list is part of a synchronisation object then caller must hold the lock on the object containing the list |
function ListGetLastEx(List:TListHandle; Remove:Boolean):PListElement;
List | Handle of List entry to get from |
---|---|
Remove | If true then remove the element from the list |
Return | List element on success, nil on failure or list empty |
Note | If list is part of a synchronisation object then caller must hold the lock on the object containing the list |
function ListInsert(List:TListHandle; Previous,Element:PListElement):LongWord;
List | Handle of List entry to insert into |
---|---|
Previous | The element to insert the new element after |
Element | The list element to be inserted |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | If list is part of a synchronisation object then caller must hold the lock on the object containing the list |
function ListRemove(List:TListHandle; Element:PListElement):LongWord;
List | Handle of List entry to remove from |
---|---|
Element | The list element to be removed |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | If list is part of a synchronisation object then caller must hold the lock on the object containing the list |
function ListIsEmpty(List:TListHandle):Boolean;
List | Handle of List entry to check |
---|---|
Return | True if List is empty or does not exist, False if List is not empty |
Note | If list is part of a synchronisation object then caller must hold the lock on the object containing the list |
function ListNotEmpty(List:TListHandle):Boolean;
List | Handle of List entry to check |
---|---|
Return | True if List is not empty, False if List is empty or does not exist |
Note | If list is part of a synchronisation object then caller must hold the lock on the object containing the list |
function ListLock(List:TListHandle):LongWord;
List | Handle of List entry to lock |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function ListUnlock(List:TListHandle):LongWord;
List | Handle of List entry to unlock |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function ListLock(List:TListHandle):LongWord;
List | Handle of List entry to lock |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function ListUnlock(List:TListHandle):LongWord;
List | Handle of List entry to unlock |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
Queue functions
function QueueCreate:TQueueHandle;
Return | Handle of new Queue entry or INVALID_HANDLE_VALUE if entry could not be created |
---|
function QueueCreateEx(QueueType:LongWord; Flags:LongWord):TQueueHandle;
QueueType | Type of queue to create (eg QUEUE_TYPE_SCHEDULE_SLEEP) |
---|---|
Flags | Flags for the new queue (eg QUEUE_FLAG_DESCENDING) |
Return | Handle of new Queue entry or INVALID_HANDLE_VALUE if entry could not be created |
function QueueDestroy(Queue:TQueueHandle):LongWord;
Queue | Handle of Queue entry to destroy |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function QueueCount(Queue:TQueueHandle):LongWord;
List | Handle of Queue entry to get from |
---|---|
Return | Queue count on success or INVALID_HANDLE_VALUE on failure |
function QueueEnqueue(Queue:TQueueHandle; Thread:TThreadHandle):LongWord;
Queue | Handle of Queue entry to add to |
---|---|
Thread | Handle of the Thread to enqueue |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | If queue is a scheduler queue then caller must hold the lock on the thread |
function QueueDequeue(Queue:TQueueHandle):TThreadHandle;
Queue | Handle of Queue entry to get from |
---|---|
Return | Handle of dequeued Thread or INVALID_HANDLE_VALUE on failure |
function QueueDequeueEx(Queue:TQueueHandle; Lock,Unlock:Boolean):TThreadHandle;
Queue | Handle of Queue entry to get from |
---|---|
Lock | Lock the Queue on entry if True |
Unlock | Unlock the Queue on exit if True |
Return | Handle of dequeued Thread or INVALID_HANDLE_VALUE on failure |
Note | Extended version used internally by the scheduler |
function QueueFirstKey(Queue:TQueueHandle):Integer;
Queue | Handle of Queue entry to get from |
---|---|
Return | First Key value from queue or QUEUE_KEY_NONE on failure |
function QueueFirstKeyEx(Queue:TQueueHandle; Lock,Unlock:Boolean):Integer;
Queue | Handle of Queue entry to get from |
---|---|
Lock | Lock the Queue on entry if True |
Unlock | Unlock the Queue on exit if True |
Return | First Key value from queue or QUEUE_KEY_NONE on failure |
Note | Extended version used internally by the scheduler |
function QueueLastKey(Queue:TQueueHandle):Integer;
Queue | Handle of Queue entry to get from |
---|---|
Return | Last Key value from queue or QUEUE_KEY_NONE on failure |
function QueueLastKeyEx(Queue:TQueueHandle; Lock,Unlock:Boolean):Integer;
Queue | Handle of Queue entry to get from |
---|---|
Lock | Lock the Queue on entry if True |
Unlock | Unlock the Queue on exit if True |
Return | Last Key value from queue or QUEUE_KEY_NONE on failure |
Note | Extended version used internally by the scheduler |
function QueueInsertKey(Queue:TQueueHandle; Thread:TThreadHandle; Key:Integer):LongWord;
Queue | Handle of Queue entry to insert into |
---|---|
Thread | Handle of thread to be inserted |
Key | The key to order the insertion on |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | If queue is a scheduler queue then caller must hold the lock on the thread} |
function QueueDeleteKey(Queue:TQueueHandle; Thread:TThreadHandle):LongWord;
Queue | Handle of Queue entry to delete from |
---|---|
Thread | Handle of thread to be deleted |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | If queue is a scheduler queue then caller must hold the lock on the thread |
function QueueIncrementKey(Queue:TQueueHandle):Integer;
Queue | Handle of Queue entry to increment in |
---|---|
Return | First Key value in queue after increment or QUEUE_KEY_NONE on failure |
function QueueDecrementKey(Queue:TQueueHandle):Integer;
Queue | Handle of Queue entry to decrement in |
---|---|
Return | First Key value in queue after decrement or QUEUE_KEY_NONE on failure |
function QueueIsEmpty(Queue:TQueueHandle):Boolean;
Queue | Handle of Queue entry to check |
---|---|
Return | True if Queue is empty or does not exist, False if Queue is not empty |
function QueueNotEmpty(Queue:TQueueHandle):Boolean;
Queue | Handle of Queue entry to check |
---|---|
Return | True if Queue is not empty, False if Queue is empty or does not exist |
function QueueLock(Queue:TQueueHandle):LongWord;
Queue | Handle of Queue entry to lock |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function QueueUnlock(Queue:TQueueHandle):LongWord;
Queue | Handle of Queue entry to unlock |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
Thread functions
function ThreadCreate(StartProc:TThreadStart; StackSize,Priority:LongWord; Name:PChar; Parameter:Pointer):TThreadHandle;
StartProc | Procedure address where the thread will start running |
---|---|
StackSize | Stack size in bytes |
Priority | Thread priority (eg THREAD_PRIORITY_NORMAL) |
Name | Name of the thread |
Parameter | Parameter passed to StartProc of new thread |
Return | Handle of new thread or INVALID_HANDLE_VALUE if a new thread could not be created |
Note | The new thread will be created suspended so it will not start running until it is scheduled with either ThreadReady or ThreadResume. Calls ThreadCreateEx with: Affinity = SCHEDULER_CPU_MASK (Run on any available CPU) CPU = SchedulerThreadNext (Assign to next CPU in round robin). |
Warning | ThreadCreate and ThreadCreateEx are only used internally by SysBeginThread and SysBeginThreadEx. These functions do not handle setting up certain RTL functionality such as thread variables, exceptions and standard input/output handles. If you need to create a standard thread use either BeginThread (or BeginThreadEx) or use the TThread class and its descendants. Only use ThreadCreate and ThreadCreateEx if you need to modify the thread creation behaviour and understand that you also need to handle the additional RTL setup. |
function ThreadCreateEx(StartProc:TThreadStart; StackSize,Priority,Affinity,CPU:LongWord; Name:PChar; Parameter:Pointer):TThreadHandle;
StartProc | Procedure address where the thread will start running |
---|---|
StackSize | Stack size in bytes |
Priority | Thread priority (eg THREAD_PRIORITY_NORMAL) |
Affinity | Thread affinity (eg CPU_AFFINITY_ALL) |
CPU | The CPU to assign new thread to |
Name | Name of the thread |
Parameter | Parameter passed to StartProc of new thread |
Return | Handle of new thread or INVALID_HANDLE_VALUE if a new thread could not be created |
Note | The new thread will be created suspended so it will not start running until it is scheduled with either ThreadReady or ThreadResume. |
Warning | ThreadCreate and ThreadCreateEx are only used internally by SysBeginThread and SysBeginThreadEx. These functions do not handle setting up certain RTL functionality such as thread variables, exceptions and standard input/output handles. If you need to create a standard thread use either BeginThread (or BeginThreadEx) or use the TThread class or its descendants. Only use ThreadCreate and ThreadCreateEx if you need to modify the thread creation behaviour and understand that you also need to handle the additional RTL setup |
function ThreadDestroy(Thread:TThreadHandle):LongWord;
Thread | Handle of thread to destroy |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function ThreadGetCurrent:TThreadHandle; inline;
Return | Thread handle of the currently running thread |
---|
function ThreadSetCurrent(Thread:TThreadHandle):LongWord; inline;
Return | ERROR_SUCCESS if completed or another error code on failure |
---|---|
Note | Must not be called except during initialization |
function ThreadGetName(Thread:TThreadHandle):String;
Thread | Handle of thread to get |
---|---|
Return | Name of thread or empty string on failure |
function ThreadSetName(Thread:TThreadHandle; const Name:String):LongWord;
Thread | Handle of thread to set |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function ThreadGetCPU(Thread:TThreadHandle):LongWord;
Thread | Handle of thread to get |
---|---|
Return | CPU of the thread or INVALID_HANDLE_VALUE on failure |
function ThreadSetCPU(Thread:TThreadHandle; CPU:LongWord):LongWord;
Thread | Handle of thread to set |
---|---|
CPU | New thread CPU (eg CPU_ID_0) |
Return | Previous CPU of thread or INVALID_HANDLE_VALUE on failure |
Note | The new CPU will not take affect until the thread is next rescheduled |
function ThreadGetState(Thread:TThreadHandle):LongWord;
Thread | Handle of thread to get |
---|---|
Return | State of the thread or INVALID_HANDLE_VALUE on failure |
function ThreadGetFlags(Thread:TThreadHandle):LongWord;
Thread | Handle of thread to get |
---|---|
Return | Flags of the thread (eg THREAD_FLAG_PERSIST) or INVALID_HANDLE_VALUE on failure |
function ThreadSetFlags(Thread:TThreadHandle; Flags:LongWord):LongWord;
Thread | Handle of thread to set |
---|---|
Flags | Flags to set (eg THREAD_FLAG_PERSIST) |
Return | ERROR_SUCCESS if completed or another error code on failure |
function ThreadAddFlags(Thread:TThreadHandle; Flags:LongWord):LongWord;
Thread | Handle of thread to add flags for |
---|---|
Flags | Flags to add (eg THREAD_FLAG_PERSIST) |
Return | ERROR_SUCCESS if completed or another error code on failure |
function ThreadRemoveFlags(Thread:TThreadHandle; Flags:LongWord):LongWord;
Thread | Handle of thread to remove flags from |
---|---|
Flags | Flags to remove (eg THREAD_FLAG_PERSIST) |
Return | ERROR_SUCCESS if completed or another error code on failure |
function ThreadGetLocale(Thread:TThreadHandle):LCID;
Thread | Handle of thread to get |
---|---|
Return | Locale of the thread or INVALID_HANDLE_VALUE on failure |
function ThreadSetLocale(Thread:TThreadHandle; Locale:LCID):LongWord;
Thread | Handle of thread to set |
---|---|
Locale | Locale Id to set |
Return | ERROR_SUCCESS if completed or another error code on failure |
function ThreadGetTimes(Thread:TThreadHandle; var CreateTime,ExitTime,KernelTime:Int64):LongWord;
Thread | Handle of thread to get |
---|---|
CreateTime | Buffer to receive the CreateTime value |
ExitTime | Buffer to receive the ExitTime value |
KernelTime | Buffer to receive the KernelTime value |
Return | ERROR_SUCCESS if completed or another error code on failure |
function ThreadGetSwitchCount(Thread:TThreadHandle; var SwitchCount:Int64):LongWord;
Thread | Handle of thread to get |
---|---|
SwitchCount | Buffer to receive the SwitchCount value |
Return | ERROR_SUCCESS if completed or another error code on failure |
function ThreadGetStackFree:LongWord;
Return | Free stack size of the current thread or 0 on error |
---|---|
Note | No lock required as only ever called by the thread itself |
function ThreadGetStackSize(Thread:TThreadHandle):LongWord;
Thread | Handle of thread to get |
---|---|
Return | Stack size of the thread or INVALID_HANDLE_VALUE on failure |
function ThreadGetStackBase(Thread:TThreadHandle):PtrUInt;
Thread | Handle of thread to get |
---|---|
Return | Stack base of the thread or INVALID_HANDLE_VALUE on failure |
function ThreadSetStackBase(Thread:TThreadHandle; StackBase:PtrUInt):LongWord;
Thread | Handle of thread to set |
---|---|
StackBase | Stack base to set |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | Must not be called except during initialization |
function ThreadGetStackPointer(Thread:TThreadHandle):PtrUInt;
Thread | Handle of thread to get |
---|---|
Return | Stack pointer of the thread or INVALID_HANDLE_VALUE on failure |
function ThreadGetExitCode(Thread:TThreadHandle):LongWord;
Thread | Handle of thread to get |
---|---|
Return | Exit code of thread, STILL_ACTIVE if the thread has not terminated or INVALID_HANDLE_VALUE on failure |
function ThreadGetAffinity(Thread:TThreadHandle):LongWord;
Thread | Handle of thread to get |
---|---|
Return | Affinity of thread or INVALID_HANDLE_VALUE on failure |
function ThreadSetAffinity(Thread:TThreadHandle; Affinity:LongWord):LongWord;
Thread | Handle of thread to set |
---|---|
Affinity | New thread affinity (eg CPU_AFFINITY_0) |
Return | Previous affinity of thread or INVALID_HANDLE_VALUE on failure |
Note | The new affinity will not take affect until the thread is next rescheduled |
function ThreadGetPriority(Thread:TThreadHandle):LongWord;
Thread | Handle of thread to get |
---|---|
Return | Priority of thread or INVALID_HANDLE_VALUE on failure |
function ThreadSetPriority(Thread:TThreadHandle; Priority:LongWord):LongWord;
Thread | Handle of thread to set |
---|---|
Priority | New thread priority (eg THREAD_PRIORITY_NORMAL) |
Return | Previous priority of thread or INVALID_HANDLE_VALUE on failure |
Note | The new priority will not take affect until the thread is next rescheduled |
function ThreadGetLastError:LongWord;
Return | Last Error of thread or ERROR_SUCCESS if no error |
---|---|
Note | No lock required as only ever called by the thread itself |
procedure ThreadSetLastError(LastError:LongWord);
Note | No lock required as only ever called by the thread itself |
---|
function ThreadSetLastErrorEx(LastError:LongWord):LongWord;
Return | ERROR_SUCCESS if completed or another error code on failure |
---|---|
Note | No lock required as only ever called by the thread itself |
function ThreadGetWaitResult:LongWord;
Return | Result of last wait timeout or ERROR_SUCCESS if no error |
---|---|
Note | No lock required as only ever called by the thread itself |
function ThreadGetReceiveResult:LongWord;
Return | Result of last receive timeout or ERROR_SUCCESS if no error |
---|---|
Note | No lock required as only ever called by the thread itself |
function ThreadGetTlsIndex(TlsIndex:LongWord):LongWord;
TlsIndex | The TLS index to get the status for |
---|---|
Return | THREAD_TLS_FREE if unused, THREAD_TLS_USED if in use or THREAD_TLS_INVALID on error |
Note | No lock required as only ever reads from the table |
function ThreadAllocTlsIndex:LongWord; inline;
Return | Allocated TLS index or TLS_OUT_OF_INDEXES on failure |
---|
function ThreadAllocTlsIndexEx(Flags:LongWord):LongWord;
Flags | The flags to apply to the TLS index entries (eg THREAD_TLS_FLAG_FREE) |
---|---|
Return | Allocated TLS index or TLS_OUT_OF_INDEXES on failure |
function ThreadReleaseTlsIndex(TlsIndex:LongWord):LongWord;
TlsIndex | The TLS index to deallocate |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function ThreadGetTlsValue(TlsIndex:LongWord):Pointer;
Return | Pointer for the specified TLS index or nil if not set or on error |
---|---|
Note | No lock required as only ever called by the thread itself |
function ThreadSetTlsValue(TlsIndex:LongWord; TlsValue:Pointer):LongWord;
TlsIndex | The TLS index to get the pointer for |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | No lock required as only ever called by the thread itself |
function ThreadGetTlsPointer(Thread:TThreadHandle):Pointer;
Thread | Handle of thread to get |
---|---|
Return | Pointer to the RTL TLS of thread or nil on failure |
function ThreadSetTlsPointer(Thread:TThreadHandle; TlsPointer:Pointer):LongWord;
Thread | Handle of thread to set |
---|---|
TlsPointer | Pointer value to set (Can be nil to clear the pointer) |
Return | ERROR_SUCCESS if completed or another error code on failure |
function ThreadReady(Thread:TThreadHandle; Reschedule:Boolean):LongWord;
Thread | Handle of thread to make ready |
---|---|
Reschedule | If True then call SchedulerReschedule |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | When called by the scheduler, thread has already been removed from the sleep queue |
function ThreadTimeout(Thread:TThreadHandle):LongWord;
Thread | Handle of thread to make ready |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | When called by the scheduler, thread has already been removed from the timeout queue |
function ThreadWake(Thread:TThreadHandle):LongWord;
Thread | Handle of thread to remove |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | A thread that was sleeping will simply return early. A thread that was waiting or receiving with a timeout will return with the error WAIT_TIMEOUT. A thread that was waiting or receiving with INFINITE timeout will return with the error WAIT_ABANDONED. |
function ThreadMigrate(Thread:TThreadHandle; CPU:LongWord):LongWord;
Thread | Handle of thread to migrate |
---|---|
CPU | New CPU for the thread |
Return | Previous CPU of thread or INVALID_HANDLE_VALUE on failure |
procedure ThreadEnd(ExitCode:LongWord);
ExitCode | The return code of the thread |
---|
function ThreadHalt(ExitCode:LongWord):LongWord;
ExitCode | The return code of the thread |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | Normally only called due to an unhandled exception etc so that the thread is put to sleep permanently without being terminated |
function ThreadTerminate(Thread:TThreadHandle; ExitCode:LongWord):LongWord;
Thread | Handle of thread to terminate |
---|---|
ExitCode | The return code of the thread |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | The terminated thread is placed on the termination queue until any threads waiting on it have been released |
function ThreadYield:LongWord;
Return | ERROR_SUCCESS if completed or another error code on failure |
---|
function ThreadSleep(Milliseconds:LongWord):LongWord;
Return | ERROR_SUCCESS if completed or another error code on failure |
---|---|
Milliseconds | Number of milliseconds to sleep |
function ThreadWait(List:TListHandle; Lock:TSpinHandle; Flags:LongWord):LongWord;
List | Handle of List entry to put thread into |
---|---|
Lock | Handle of Lock to release before going into wait state |
Flags | Flag to indicate which unlock method to use |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | Caller must hold the lock on the synchronisation object containing the list |
function ThreadWaitEx(List:TListHandle; Lock:TSpinHandle; Flags,Timeout:LongWord):LongWord;
List | Handle of List entry to put thread into |
---|---|
Lock | Handle of Lock to release before going into wait state |
Flags | Flag to indicate which unlock method to use |
Timeout | Milliseconds to wait before timeout (INFINITE equals wait forever) |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | Caller must hold the lock on the synchronisation object containing the list |
function ThreadRelease(List:TListHandle):LongWord;
List | Handle of List entry to release thread from |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | Caller must hold the lock on the synchronisation object containing the list |
function ThreadAbandon(List:TListHandle):LongWord;
List | Handle of List entry to release thread from |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | Caller must hold the lock on the synchronisation object containing the list |
function ThreadWaitTerminate(Thread:TThreadHandle; Timeout:LongWord):LongWord;
Thread | Handle of the thread to wait on |
---|---|
Timeout | Milliseconds to wait before timeout (0 equals do not wait, INFINITE equals wait forever) |
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | The wait can be abandoned by calling ThreadWake with the handle of the waiting thread |
function ThreadSuspend(Thread:TThreadHandle):LongWord;
Thread | Handle of thread to suspend |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | Suspending a thread from another thread is not safe unless specific precautions are taken to prevent deadlocks. It is normally safe for a thread to suspend itself as long as it releases any locks it is holding that may be required by other threads before suspending. |
function ThreadResume(Thread:TThreadHandle):LongWord;
Thread | Handle of thread to resume |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function ThreadWaitMessage:LongWord;
Return | ERROR_SUCCESS if completed or another error code on failure |
---|---|
Note | The received message is not removed from the message list |
function ThreadSendMessage(Thread:TThreadHandle; const Message:TMessage):LongWord;
Thread | Handle of thread to send to |
---|---|
Message | Contents of message to send |
Return | ERROR_SUCCESS if completed or another error code on failure |
function ThreadReceiveMessage(var Message:TMessage):LongWord;
Message | The received message if successful, undefined on error |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function ThreadReceiveMessageEx(var Message:TMessage; Timeout:LongWord; Remove:Boolean):LongWord;
Message | The received message if successful, undefined on error |
---|---|
Timeout | Milliseconds to wait before timeout (0 equals do not wait, INFINITE equals wait forever) |
Remove | If true then remove the received message from the message list |
Return | ERROR_SUCCESS if completed or another error code on failure |
function ThreadAbandonMessage(Thread:TThreadHandle):LongWord;
Thread | Handle of thread to abandon waiting |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | The waiting thread will return with ERROR_WAIT_ABANDONED or ERROR_WAIT_TIMEOUT |
function ThreadLock(Thread:TThreadHandle):LongWord;
Thread | Handle of thread to lock |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | Locking a thread will also disable IRQ or FIQ depending on scheduler settings. The lock should only be held for the briefest time possible. |
function ThreadUnlock(Thread:TThreadHandle):LongWord;
Thread | Handle of thread to unlock |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | Locking a thread will also disable IRQ or FIQ depending on scheduler settings. The lock should only be held for the briefest time possible. |
procedure ThreadTimer(Data:Pointer);
Note | Not intended to be called directly by applications |
---|
Scheduler functions
function SchedulerCheck(CPUID:LongWord):LongWord;
CPUID | The ID of the current CPU |
---|---|
Return | ERROR_SUCCESS if either first key is zero, ERROR_NO_MORE_ITEMS if both queues are empty or another error code on failure |
Note | Called by scheduler interrupt with IRQ or FIQ disabled and running on the IRQ or FIQ thread |
function SchedulerWakeup(CPUID:LongWord):LongWord;
CPUID | The ID of the current CPU |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | Called by scheduler interrupt with IRQ or FIQ disabled and running on the IRQ or FIQ thread |
function SchedulerExpire(CPUID:LongWord):LongWord;
CPUID | The ID of the current CPU |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | Called by scheduler interrupt with IRQ or FIQ disabled and running on the IRQ or FIQ thread |
function SchedulerSwitch(CPUID:LongWord; Thread:TThreadHandle):TThreadHandle;
CPUID | The ID of the current CPU |
---|---|
Thread | The handle of the currently running thread (Before IRQ or FIQ occurred) |
Return | The handle of the current thread which may be the old thread or a new thread |
Note | Called by scheduler interrupt with IRQ or FIQ disabled and running on the IRQ or FIQ thread |
function SchedulerSelect(CPUID:LongWord; Thread:TThreadHandle; Yield:Boolean):TThreadHandle;
CPUID | The ID of the current CPU |
---|---|
Thread | The handle of the currently running thread (Before IRQ or FIQ occurred or when Reschedule was called) |
Yield | True if the current thread is giving up its remaining time slice |
Return | The handle of the next thread to run or INVALID_HANDLE_VALUE on no selection or error |
Note | Called either by scheduler interrupt with IRQ or FIQ disabled and running on the IRQ or FIQ thread. Or by scheduler reschedule with IRQ or FIQ disabled and running on the current thread. Caller must either hold a lock on the current thread or have disabled IRQ or FIQ. |
function SchedulerReschedule(Yield:Boolean):LongWord;
Yield | True if the current thread is giving up its remaining time slice |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | Called by the currently running thread to force a reschedule before sleeping, waiting etc |
function SchedulerMigrationEnable:LongWord;
Return | ERROR_SUCCESS if completed or another error code on failure |
---|
function SchedulerMigrationDisable:LongWord;
Return | ERROR_SUCCESS if completed or another error code on failure |
---|
function SchedulerPreemptEnable(CPUID:LongWord):LongWord;
CPUID | The ID of the CPU to enable for |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function SchedulerPreemptDisable(CPUID:LongWord):LongWord;
CPUID | The ID of the CPU to disable for |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function SchedulerAllocationEnable(CPUID:LongWord):LongWord;
CPUID | The ID of the CPU to enable for |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function SchedulerAllocationDisable(CPUID:LongWord):LongWord;
CPUID | The ID of the CPU to disable for |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
Messageslot functions
function MessageslotCreate:TMessageslotHandle;
Return | Handle of new Messageslot entry or INVALID_HANDLE_VALUE if entry could not be created |
---|
function MessageslotCreateEx(Maximum:LongWord; Flags:LongWord):TMessageslotHandle;
Maximum | Maximum number of messages allowed for the Messageslot (Must be greater than zero) |
---|---|
Flags | The flags for the Messageslot entry (eg MESSAGESLOT_FLAG_IRQ) |
Return | Handle of new Messageslot entry or INVALID_HANDLE_VALUE if entry could not be created |
function MessageslotDestroy(Messageslot:TMessageslotHandle):LongWord;
Messageslot | Handle of Messageslot entry to destroy |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function MessageslotCount(Messageslot:TMessageslotHandle):LongWord;
Messageslot | Messageslot to get from |
---|---|
Return | Number of messages or INVALID_HANDLE_VALUE on error |
function MessageslotSend(Messageslot:TMessageslotHandle; const Message:TMessage):LongWord;
Messageslot | Messageslot to send to |
---|---|
Message | Contents of message to send |
Return | ERROR_SUCCESS if completed or another error code on failure |
function MessageslotReceive(Messageslot:TMessageslotHandle; var Message:TMessage):LongWord;
Messageslot | Messageslot to receive from |
---|---|
Message | The received message if successful, undefined on error |
Return | ERROR_SUCCESS if completed or another error code on failure |
function MessageslotReceiveEx(Messageslot:TMessageslotHandle; var Message:TMessage; Timeout:LongWord):LongWord;
Messageslot | Messageslot to receive from |
---|---|
Message | The received message if successful, undefined on error |
Timeout | Milliseconds to wait before timeout (0 equals do not wait, INFINITE equals wait forever) |
Return | ERROR_SUCCESS if completed or another error code on failure |
Mailslot functions
function MailslotCreate(Maximum:LongWord):TMailslotHandle;
Maximum | Maximum number of messages allowed for the Mailslot (Must be greater than zero) |
---|---|
Return | Handle of new Mailslot entry or INVALID_HANDLE_VALUE if entry could not be created |
function MailslotDestroy(Mailslot:TMailslotHandle):LongWord;
Mailslot | Handle of Mailslot entry to destroy |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function MailslotCount(Mailslot:TMailslotHandle):LongWord;
Mailslot | Mailslot to get from |
---|---|
Return | Number of messages or INVALID_HANDLE_VALUE on error |
function MailslotSend(Mailslot:TMailslotHandle; Data:PtrInt):LongWord;
Mailslot | Mailslot to send to |
---|---|
Data | Message to send to mailslot |
Return | ERROR_SUCCESS if completed or another error code on failure |
function MailslotSendEx(Mailslot:TMailslotHandle; Data:PtrInt; Timeout:LongWord):LongWord;
Mailslot | Mailslot to send to |
---|---|
Data | Message to send to mailslot |
Timeout | Milliseconds to wait before timeout (0 equals do not wait, INFINITE equals wait forever) |
Return | ERROR_SUCCESS if completed or another error code on failure |
function MailslotReceive(Mailslot:TMailslotHandle):PtrInt;
Mailslot | Mailslot to receive from |
---|---|
Return | Received message or INVALID_HANDLE_VALUE on error |
function MailslotReceiveEx(Mailslot:TMailslotHandle; Timeout:LongWord):PtrInt;
Timeout | Timeout = 0 then No Wait, Timeout = INFINITE then Wait forever |
---|
Buffer functions
function BufferCreate(Size,Count:LongWord):TBufferHandle;
Size | Size of each buffer in bytes |
---|---|
Count | Total number of buffers |
Return | Handle of new Buffer entry or INVALID_HANDLE_VALUE if entry could not be created |
function BufferCreateEx(Size,Count,Flags:LongWord):TBufferHandle;
Size | Size of each buffer in bytes |
---|---|
Count | Total number of buffers |
Flags | Flags for buffer (eg BUFFER_FLAG_SHARED) |
Return | Handle of new Buffer entry or INVALID_HANDLE_VALUE if entry could not be created |
function BufferDestroy(Buffer:TBufferHandle):LongWord;
Buffer | Handle of Buffer entry to destroy |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function BufferCount(Buffer:TBufferHandle):LongWord;
Buffer | Buffer to get total count for |
---|---|
Return | Total count or INVALID_HANDLE_VALUE on error |
function BufferAvailable(Buffer:TBufferHandle):LongWord;
Buffer | Buffer to get available count for |
---|---|
Return | Available count or INVALID_HANDLE_VALUE on error |
function BufferGet(Buffer:TBufferHandle):Pointer;
Buffer | Handle of Buffer entry to allocate from |
---|---|
Return | A pointer to the allocated buffer or nil on error |
function BufferGetEx(Buffer:TBufferHandle; Timeout:LongWord):Pointer;
Buffer | Handle of Buffer entry to allocate from |
---|---|
Timeout | Milliseconds to wait before timeout (0 equals do not wait, INFINITE equals wait forever) |
Return | A pointer to the allocated buffer or nil on error |
function BufferFree(Buffer:Pointer):LongWord;
Buffer | Pointer to the allocated buffer (As returned by BufferGet/BufferGetEx) |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function BufferIterate(Buffer:TBufferHandle; Previous:Pointer):Pointer;
Buffer | Handle of Buffer entry to iterate from |
---|---|
Previous | The pointer returned by the previous call or nil on first call |
Return | A pointer to the next buffer or nil on error |
Event functions
function EventCreate(ManualReset,InitialState:Boolean):TEventHandle;
ManualReset | Create a manual reset event if true or an auto reset event if false. A manual reset event must be reset by calling EventReset. An auto reset event is reset when a single waiting thread is released. |
---|---|
InitialState | Set the initial state of the event to signaled if true or to unsignaled if false |
Return | Handle of new Event entry or INVALID_HANDLE_VALUE if entry could not be created |
function EventCreateEx(Flags:LongWord):TEventHandle;
Flags | Event flags to use for the new entry (eg EVENT_FLAG_MANUAL_RESET) |
---|---|
Return | Handle of new Event entry or INVALID_HANDLE_VALUE if entry could not be created |
function EventDestroy(Event:TEventHandle):LongWord;
Event | Handle of Event entry to destroy |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function EventState(Event:TEventHandle):LongWord;
Event | Event to get state for |
---|---|
Return | Current state or INVALID_HANDLE_VALUE on error |
function EventWait(Event:TEventHandle):LongWord;
Event | Event to wait on |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | If the Event is currently signaled then simply return immediately. If the Event is currently unsignaled then wait for it to be signaled before returning. |
function EventWaitEx(Event:TEventHandle; Timeout:LongWord):LongWord;
Event | Event to wait on |
---|---|
Timeout | Time in milliseconds to wait for the event to be signaled
0 = No Wait
|
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | If the Event is currently signaled then simply return immediately. If the Event is currently unsignaled then wait for it to be signaled before returning. |
function EventSet(Event:TEventHandle):LongWord;
Event | Event to set |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | If the event is currently signaled then return with no action. If the event is unsignaled then, if the event is manual reset release all waiting threads and return. If the event is auto reset release one waiting thread, unsignal the event and return. If no threads are waiting then simply signal the event and return, if the event is auto reset then the next thread to wait will unsignal the event. |
function EventReset(Event:TEventHandle):LongWord;
Event | Event to reset |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | If the event is currently unsignaled then return with no action. If the event is signaled then unsignal the event and return. |
function EventPulse(Event:TEventHandle):LongWord;
Event | Event to pulse |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
Note | If the event is currently signaled then unsignal the event and return. If the event is unsignaled then, if the event is manual reset release all waiting threads, unsignal the event and return. If the event is auto reset release one waiting thread, unsignal the event and return. If no threads are waiting then simply unsignal the event and return. |
Timer functions
function TimerCreate(Interval:LongWord; Enabled,Reschedule:Boolean; Event:TTimerEvent; Data:Pointer):TTimerHandle;
Interval | Number of milliseconds between timer events |
---|---|
Enabled | If true then timer generates events |
Reschedule | If true then reschedule timer after each event |
Event | The function to call when the timer event is generated |
Data | Data to be passed to the function when the timer event is generated (May be nil) |
Return | Handle of new Timer entry or INVALID_HANDLE_VALUE if entry could not be created |
function TimerCreateEx(Interval,State,Flags:LongWord; Event:TTimerEvent; Data:Pointer):TTimerHandle;
Interval | Number of milliseconds between timer events |
---|---|
State | State of timer entry (eg TIMER_STATE_ENABLED) |
Flags | Flags of timer entry (eg TIMER_FLAG_RESCHEDULE) |
Event | The function to call when the timer event is generated |
Data | Data to be passed to the function when the timer event is generated (May be nil) |
Return | Handle of new Timer entry or INVALID_HANDLE_VALUE if entry could not be created |
function TimerDestroy(Timer:TTimerHandle):LongWord;
Timer | Handle of Timer entry to destroy |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function TimerEnable(Timer:TTimerHandle):LongWord;
Timer | Handle of Timer entry to enable |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function TimerEnableEx(Timer:TTimerHandle; Interval:LongWord; Event:TTimerEvent; Data:Pointer):LongWord;
Timer | Handle of Timer entry to enable |
---|---|
Interval | Number of milliseconds between timer events |
Event | The function to call when the timer event is generated |
Data | Data to be passed to the function when the timer event is generated (May be nil) |
Return | ERROR_SUCCESS if completed or another error code on failure |
function TimerDisable(Timer:TTimerHandle):LongWord;
Timer | Handle of Timer entry to disable |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function TimerDequeue:TTimerHandle;
Note | None documented |
---|
function TimerFirstKey:Integer;
Note | None documented |
---|
function TimerInsertKey(Timer:TTimerHandle; Key:Integer):LongWord;
Note | None documented |
---|
function TimerDeleteKey(Timer:TTimerHandle):LongWord;
Note | None documented |
---|
function TimerDecrementKey:Integer;
Note | None documented |
---|
function TimerIsEmpty:Boolean;
Note | None documented |
---|
function TimerNotEmpty:Boolean;
Note | None documented |
---|
function TimerCheck:LongWord;
Note | None documented |
---|
function TimerTrigger:LongWord;
Note | None documented |
---|
Worker functions
function WorkerSchedule(Interval:LongWord; Task:TWorkerTask; Data:Pointer; Callback:TWorkerCallback):LongWord;
Note | None documented |
---|
function WorkerScheduleEx(Interval,Flags:LongWord; Task:TWorkerTask; Data:Pointer; Callback:TWorkerCallback):TWorkerHandle;
Note | None documented |
---|
function WorkerCancel(Worker:TWorkerHandle):LongWord;
Note | None documented |
---|
function WorkerScheduleIRQ(Affinity:LongWord; Task:TWorkerTask; Data:Pointer; Callback:TWorkerCallback):LongWord;
Note | None documented |
---|
function WorkerScheduleIRQEx(Affinity,Flags:LongWord; Task:TWorkerTask; Data:Pointer; Callback:TWorkerCallback):LongWord;
Note | None documented |
---|
function WorkerScheduleFIQ(Affinity:LongWord; Task:TWorkerTask; Data:Pointer; Callback:TWorkerCallback):LongWord;
Note | None documented |
---|
function WorkerScheduleFIQEx(Affinity,Flags:LongWord; Task:TWorkerTask; Data:Pointer; Callback:TWorkerCallback):LongWord;
Note | None documented |
---|
function WorkerIncrease(Count:LongWord):LongWord; inline;
Note | None documented |
---|
function WorkerIncreaseEx(Count:LongWord; Priority:Boolean):LongWord;
Note | None documented |
---|
function WorkerDecrease(Count:LongWord):LongWord; inline;
Note | None documented |
---|
function WorkerDecreaseEx(Count:LongWord; Priority:Boolean):LongWord;
Note | None documented |
---|
procedure WorkerTimer(WorkerRequest:PWorkerRequest);
Note | Not intended to be called directly by applications |
---|
Tasker functions
function TaskerThreadSendMessage(Thread:TThreadHandle; const Message:TMessage):LongWord;
Note | None documented |
---|
function TaskerMessageslotSend(Messageslot:TMessageslotHandle; const Message:TMessage):LongWord;
Note | None documented |
---|
function TaskerSemaphoreSignal(Semaphore:TSemaphoreHandle; Count:LongWord):LongWord;
Note | None documented |
---|
function TaskerCompletionReset(Completion:TCompletionHandle):LongWord;
Note | None documented |
---|
function TaskerCompletionComplete(Completion:TCompletionHandle; All:Boolean):LongWord;
Note | None documented |
---|
function TaskerEnqueue(Task:PTaskerTask):LongWord;
Return | ERROR_SUCCESS if completed or another error code on failure |
---|
function TaskerDequeue:PTaskerTask;
Return | Dequeued Task or nil on failure (or list empty) |
---|
function TaskerCheck:LongWord;
Return | ERROR_SUCCESS if the list contains tasks, ERROR_NO_MORE_ITEMS if list is empty or another error code on failure |
---|---|
Note | Called by clock interrupt with IRQ or FIQ disabled and running on the IRQ or FIQ thread |
function TaskerTrigger:LongWord;
Return | ERROR_SUCCESS if completed or another error code on failure |
---|---|
Note | Called by clock interrupt with IRQ or FIQ disabled and running on the IRQ or FIQ thread |
function TaskerGetCount:LongWord;
Note | None documented |
---|
RTL initialize and exit functions
procedure SysInitProc;
Note | None documented |
---|
procedure SysExitProc;
Note | None documented |
---|
function SysInitCompleted:Boolean;
Note | None documented |
---|
RTL process functions
function SysGetProcessID:SizeUInt;
Note | None documented |
---|
RTL thread manager functions
function ThreadMain(Parameter:Pointer):PtrInt;
Note | None documented |
---|
function SysBeginThread(SignalAction:Pointer; StackSize:PtrUInt; ThreadFunction:TThreadFunc; ThreadParameter:Pointer; CreationFlags:DWORD; var ThreadId:TThreadID):TThreadID;
Note | None documented |
---|
function SysBeginThreadEx(SignalAction:Pointer; StackSize:PtrUInt; ThreadFunction:TThreadFunc; ThreadParameter:Pointer; CreationFlags:DWORD; Priority,Affinity,CPU:LongWord; Name:PChar; var ThreadId:TThreadID):TThreadID;
Note | None documented |
---|
procedure SysEndThread(ExitCode:DWORD);
Note | None documented |
---|
function SysSuspendThread(ThreadHandle:TThreadID):DWORD;
Note | None documented |
---|
function SysResumeThread(ThreadHandle:TThreadID):DWORD;
Note | None documented |
---|
function SysKillThread(ThreadHandle:TThreadID):DWORD;
Note | None documented |
---|
function SysCloseThread(ThreadHandle:TThreadID):DWORD;
Note | None documented |
---|
procedure SysThreadSwitch;
Note | None documented |
---|
function SysWaitForThreadTerminate(ThreadHandle:TThreadID; TimeoutMs:LongInt):DWORD;
Timeout | 0=No Timeout |
---|
function SysThreadSetPriority(ThreadHandle:TThreadID; Priority:LongInt):Boolean;
Note | -15..+15, 0=Normal |
---|
function SysThreadGetPriority(ThreadHandle:TThreadID):LongInt;
Note | None documented |
---|
function SysGetCurrentThreadId:TThreadID;
Note | None documented |
---|
procedure SysSetThreadDebugNameA(ThreadHandle:TThreadID; const ThreadName:AnsiString);
Note | None documented |
---|
procedure SysSetThreadDebugNameU(ThreadHandle:TThreadID; const ThreadName:UnicodeString);
Note | None documented |
---|
procedure SysInitCriticalSection(var CriticalSection);
Note | None documented |
---|
procedure SysDoneCriticalSection(var CriticalSection);
Note | None documented |
---|
procedure SysEnterCriticalSection(var CriticalSection);
Note | None documented |
---|
function SysTryEnterCriticalSection(var CriticalSection):LongInt;
Note | None documented |
---|
procedure SysLeaveCriticalSection(var CriticalSection);
Note | None documented |
---|
procedure SysInitThreadVar(var Offset:DWORD; Size:DWORD);
Note | None documented |
---|
function SysRelocateThreadVar(Offset:DWORD):Pointer;
Note | None documented |
---|
procedure SysAllocateThreadVars;
Note | None documented |
---|
procedure SysReleaseThreadVars;
Note | None documented |
---|
function SysBasicEventCreate(EventAttributes:Pointer; AManualReset,InitialState:Boolean; const Name:AnsiString):PEventState;
Note | None documented |
---|
procedure SysBasicEventDestroy(State:PEventState);
Note | None documented |
---|
procedure SysBasicEventResetEvent(State:PEventState);
Note | None documented |
---|
procedure SysBasicEventSetEvent(State:PEventState);
Note | None documented |
---|
function SysBasicEventWaitFor(Timeout:Cardinal; State:PEventState):LongInt;
Timeout | 0=No Timeout |
---|
function SysRTLEventCreate:PRTLEvent;
Note | None documented |
---|
procedure SysRTLEventDestroy(AEvent:PRTLEvent);
Note | None documented |
---|
procedure SysRTLEventSetEvent(AEvent:PRTLEvent);
Note | None documented |
---|
procedure SysRTLEventResetEvent(AEvent:PRTLEvent);
Note | None documented |
---|
procedure SysRTLEventWaitFor(AEvent:PRTLEvent);
Note | None documented |
---|
procedure SysRTLEventWaitForTimeout(AEvent:PRTLEvent; Timeout:LongInt);
Timeout | 0=No Timeout |
---|
function SysSemaphoreInit:Pointer;
Note | None documented |
---|
procedure SysSemaphoreDestroy(const Semaphore:Pointer);
Note | None documented |
---|
procedure SysSemaphorePost(const Semaphore:Pointer);
Note | None documented |
---|
procedure SysSemaphoreWait(const Semaphore:Pointer);
Note | None documented |
---|
Thread helper functions
function SpinGetCount:LongWord;
Note | None documented |
---|
function MutexGetCount:LongWord;
Note | None documented |
---|
function CriticalSectionGetCount:LongWord;
Note | None documented |
---|
function SemaphoreGetCount:LongWord;
Note | None documented |
---|
function SynchronizerGetCount:LongWord;
Note | None documented |
---|
function ConditionGetCount:LongWord;
Note | None documented |
---|
function CompletionGetCount:LongWord;
Note | None documented |
---|
function ListGetCount:LongWord;
Note | None documented |
---|
function QueueGetCount:LongWord;
Note | None documented |
---|
function ThreadGetCount:LongWord;
Note | None documented |
---|
function ThreadTlsGetCount:LongWord;
Note | None documented |
---|
function ThreadAllocateStack(StackSize:LongWord):Pointer;
Note | None documented |
---|
procedure ThreadReleaseStack(StackBase:Pointer; StackSize:LongWord);
Note | None documented |
---|
function ThreadSetupStack(StackBase:Pointer; StartProc:TThreadStart; ReturnProc:TThreadEnd; Parameter:Pointer):Pointer;
Note | None documented |
---|
function ThreadSnapshotCreate:PThreadSnapshot;
Note | None documented |
---|
function ThreadSnapshotDestroy(ASnapshot:PThreadSnapshot):LongWord;
Note | None documented |
---|
function MessageslotGetCount:LongWord;
Note | None documented |
---|
function MailslotGetCount:LongWord;
Note | None documented |
---|
function BufferGetCount:LongWord;
Note | None documented |
---|
function EventGetCount:LongWord;
Note | None documented |
---|
function TimerGetCount:LongWord;
Note | None documented |
---|
function WorkerGetCount:LongWord;
Note | None documented |
---|
function WorkerGetPriorityCount:LongWord;
Note | None documented |
---|
function ListTypeToString(ListType:LongWord):String;
Note | None documented |
---|
function QueueTypeToString(QueueType:LongWord):String;
Note | None documented |
---|
function ThreadTypeToString(ThreadType:LongWord):String;
Note | None documented |
---|
function ThreadStateToString(ThreadState:LongWord):String;
Note | None documented |
---|
function ThreadPriorityToString(ThreadPriority:LongWord):String;
Note | None documented |
---|
procedure ThreadLog(Level:LongWord; const AText:String);
Note | None documented |
---|
procedure ThreadLogInfo(const AText:String); inline;
Note | None documented |
---|
procedure ThreadLogWarn(const AText:String); inline;
Note | None documented |
---|
procedure ThreadLogError(const AText:String); inline;
Note | None documented |
---|
procedure ThreadLogDebug(const AText:String); inline;
Note | None documented |
---|
Scheduler helper functions
function SchedulerGetListFlags(ListType:LongWord):LongWord;
Note | None documented |
---|
function SchedulerGetQueueFlags(QueueType:LongWord):LongWord;
Note | None documented |
---|
function SchedulerGetQueueHandle(CPUID:LongWord; QueueType:LongWord):TQueueHandle;
Note | None documented |
---|
function SchedulerGetQueueHandleEx(CPUID:LongWord; Priority:LongWord):TQueueHandle;
Note | None documented |
---|
function SchedulerGetThreadCount(CPUID:LongWord):LongWord;
Note | None documented |
---|
function SchedulerGetThreadQuantum(CPUID:LongWord):LongWord;
Note | None documented |
---|
function SchedulerGetThreadHandle(CPUID:LongWord; ThreadType:LongWord):TThreadHandle;
Note | None documented |
---|
function SchedulerGetPriorityMask(CPUID:LongWord):LongWord;
Note | None documented |
---|
function SchedulerGetPriorityQuantum(Priority:LongWord):LongWord;
Note | None documented |
---|
function SchedulerSetPriorityQuantum(Priority,Quantum:LongWord):LongWord;
Note | None documented |
---|
function SchedulerGetMigrationQuantum:LongWord;
Note | None documented |
---|
function SchedulerGetStarvationQuantum(CPUID:LongWord):LongWord;
Note | None documented |
---|
function SchedulerGetThreadNext:LongWord;
Note | None documented |
---|
function SchedulerGetThreadMigration:LongWord;
Note | None documented |
---|
function SchedulerGetThreadPreempt(CPUID:LongWord):LongWord;
Note | None documented |
---|
function SchedulerGetThreadAllocation(CPUID:LongWord):LongWord;
Note | None documented |
---|
function SchedulerMigrationToString(Migration:LongWord):String;
Note | None documented |
---|
function SchedulerPreemptToString(Preempt:LongWord):String;
Note | None documented |
---|
function SchedulerAllocationToString(Allocation:LongWord):String;
Note | None documented |
---|
Timer helper functions
function TimerGetListFlags:LongWord;
Note | None documented |
---|
function TimerGetMessageslotFlags:LongWord;
Note | None documented |
---|
Worker helper functions
function WorkerGetMessageslotFlags:LongWord;
Note | None documented |
---|
Return to Unit Reference