Difference between revisions of "Unit Threads"
From Ultibo.org
Line 942: | Line 942: | ||
! '''Note''' | ! '''Note''' | ||
| If any threads are waiting on the Semaphore then one thread will be woken up and placed on the ready queue for each interation of the count passed. If no threads are wait then the Semaphore count will be incremented once for each interation of the count passed. | | If any threads are waiting on the Semaphore then one thread will be woken up and placed on the ready queue for each interation of the count passed. If no threads are wait then the Semaphore count will be incremented once for each interation 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. | ||
|- | |- | ||
|} | |} |
Revision as of 01:23, 9 September 2016
Return to Unit Reference
Contents
[hide]Description
To be documented
Constants
To be documented
Type definitions
To be documented
Public variables
To be documented
Function declarations
Initialization functions
[Expand]
procedure SchedulerStart(CPUID:LongWord);
Description: Initialize the thread scheduler for secondary CPUs (Where Applicable)
[Expand]
procedure SecondaryBoot(CPUID:LongWord);
Description: Boot the specified secondary CPU (Where Applicable)
[Expand]
procedure SecondaryStart(CPUID:LongWord);
Description: Startup procedure for secondary CPUs (Where Applicable)
[Expand]
function IdleCalibrate:LongWord;
Description: Calibrate the idle thread loop by counting the number of loops in 100ms
Spin functions
[Expand]
function SpinCreateEx(InitialOwner:Boolean):TSpinHandle;
Description: Create and insert a new Spin entry
[Expand]
function SpinDestroy(Spin:TSpinHandle):LongWord;
Description: Destroy and remove an existing Spin entry
[Expand]
function SpinOwner(Spin:TSpinHandle):TThreadHandle;
Description: Get the current owner of an existing Spin entry
[Expand]
function SpinLockIRQ(Spin:TSpinHandle):LongWord;
Description: Lock an existing Spin entry, disable IRQ and save the previous IRQ state
[Expand]
function SpinUnlockIRQ(Spin:TSpinHandle):LongWord;
Description: Unlock an existing Spin entry and restore the previous IRQ state
[Expand]
function SpinLockFIQ(Spin:TSpinHandle):LongWord;
Description: Lock an existing Spin entry, disable FIQ and save the previous FIQ state
[Expand]
function SpinUnlockFIQ(Spin:TSpinHandle):LongWord;
Description: Unlock an existing Spin entry and restore the previous FIQ state
[Expand]
function SpinLockIRQFIQ(Spin:TSpinHandle):LongWord;
Description: Lock an existing Spin entry, disable IRQ and FIQ and save the previous IRQ and FIQ state
[Expand]
function SpinUnlockIRQFIQ(Spin:TSpinHandle):LongWord;
Description: Unlock an existing Spin entry and restore the previous IRQ and FIQ state
[Expand]
function SpinCheckIRQ(Spin:TSpinHandle):Boolean;
Description: Check the mask that stores the previous IRQ state to determine if IRQ is enabled
[Expand]
function SpinCheckFIQ(Spin:TSpinHandle):Boolean;
Description: Check the mask that stores the previous FIQ state to determine if FIQ is enabled
[Expand]
function SpinExchangeIRQ(Spin1,Spin2:TSpinHandle):LongWord;
Description: Exchange the previous IRQ state between two Spin entries
[Expand]
function SpinExchangeFIQ(Spin1,Spin2:TSpinHandle):LongWord;
Description: Exchange the previous FIQ state between two Spin entries
Mutex functions
[Expand]
function MutexCreateEx(InitialOwner:Boolean; SpinCount:LongWord; Flags:LongWord):TMutexHandle;
Description: Create and insert a new Mutex entry
[Expand]
function MutexDestroy(Mutex:TMutexHandle):LongWord;
Description: Destroy and remove an existing Mutex entry
[Expand]
function MutexFlags(Mutex:TMutexHandle):LongWord;
Description: Get the current flags of an existing Mutex entry
[Expand]
function MutexCount(Mutex:TMutexHandle):LongWord;
Description: Get the current lock count of an existing Mutex entry
[Expand]
function MutexOwner(Mutex:TMutexHandle):TThreadHandle;
Description: Get the current owner of an existing Mutex entry
[Expand]
function MutexUnlock(Mutex:TMutexHandle):LongWord;
Description: Unlock an existing Mutex entry
[Expand]
function MutexTryLock(Mutex:TMutexHandle):LongWord;
Description: Try to lock an existing Mutex entry
Critical section functions
[Expand]
function CriticalSectionCreate:TCriticalSectionHandle;
Description: Create and insert a new CriticalSection entry
[Expand]
function CriticalSectionCreateEx(InitialOwner:Boolean; SpinCount:LongWord):TCriticalSectionHandle;
Description: Create and insert a new CriticalSection entry
[Expand]
function CriticalSectionDestroy(CriticalSection:TCriticalSectionHandle):LongWord;
Description: Destroy and remove an existing CriticalSection entry
[Expand]
function CriticalSectionCount(CriticalSection:TCriticalSectionHandle):LongWord;
Description: Get the current lock count of an existing CriticalSection entry
[Expand]
function CriticalSectionOwner(CriticalSection:TCriticalSectionHandle):TThreadHandle;
Description: Get the current owner of an existing CriticalSection entry
[Expand]
function CriticalSectionSetSpinCount(CriticalSection:TCriticalSectionHandle; SpinCount:LongWord):LongWord;
Description: Set the spin count of an existing CriticalSection entry
[Expand]
function CriticalSectionLock(CriticalSection:TCriticalSectionHandle):LongWord;
Description: Lock an existing CriticalSection entry
[Expand]
function CriticalSectionLockEx(CriticalSection:TCriticalSectionHandle; Timeout:LongWord):LongWord;
Description: Lock an existing CriticalSection entry
[Expand]
function CriticalSectionUnlock(CriticalSection:TCriticalSectionHandle):LongWord;
Description: Unlock an existing CriticalSection entry
[Expand]
function CriticalSectionTryLock(CriticalSection:TCriticalSectionHandle):LongWord;
Description: Try to lock an existing CriticalSection entry
Semaphore functions
[Expand]
function SemaphoreCreate(Count:LongWord):TSemaphoreHandle;
Description: Create and insert a new Semaphore entry
[Expand]
function SemaphoreCreateEx(Count,Maximum:LongWord; Flags:LongWord):TSemaphoreHandle;
Description: Create and insert a new Semaphore entry
[Expand]
function SemaphoreDestroy(Semaphore:TSemaphoreHandle):LongWord;
Description: Destroy and remove an existing Semaphore entry
[Expand]
function SemaphoreCount(Semaphore:TSemaphoreHandle):LongWord;
Description: Get the current count of an existing Semaphore entry
[Expand]
function SemaphoreWait(Semaphore:TSemaphoreHandle):LongWord;
Description: Wait on an existing Semaphore entry
[Expand]
function SemaphoreWaitEx(Semaphore:TSemaphoreHandle; Timeout:LongWord):LongWord;
Description: Wait on an existing Semaphore entry
[Expand]
function SemaphoreSignal(Semaphore:TSemaphoreHandle):LongWord;
Description: Signal an existing Semaphore entry
[Expand]
function SemaphoreSignalEx(Semaphore:TSemaphoreHandle; Count:LongWord; Previous:PLongWord):LongWord;
Description: Signal an existing Semaphore entry one or more times
Synchronizer functions
[Expand]
function SynchronizerCreate:TSynchronizerHandle;
Description: Create and insert a new Synchronizer entry
[Expand]
function SynchronizerCreateEx(InitialReader,InitialWriter:Boolean):TSynchronizerHandle;
Description: Create and insert a new Synchronizer entry
[Expand]
function SynchronizerDestroy(Synchronizer:TSynchronizerHandle):LongWord;
Description: Destroy and remove an existing Synchronizer entry
[Expand]
function SynchronizerReaderCount(Synchronizer:TSynchronizerHandle):LongWord;
Description: Get the current reader count of an existing Synchronizer entry
[Expand]
function SynchronizerReaderLast(Synchronizer:TSynchronizerHandle):TThreadHandle;
Description: Get the last reader thread of an existing Synchronizer entry
[Expand]
function SynchronizerReaderLock(Synchronizer:TSynchronizerHandle):LongWord;
Description: Lock an existing Synchronizer entry for reading
[Expand]
function SynchronizerReaderLockEx(Synchronizer:TSynchronizerHandle; Timeout:LongWord):LongWord;
Description: Lock an existing Synchronizer entry for reading
[Expand]
function SynchronizerReaderUnlock(Synchronizer:TSynchronizerHandle):LongWord;
Description: Unlock an existing Synchronizer entry
[Expand]
function SynchronizerReaderConvert(Synchronizer:TSynchronizerHandle):LongWord;
Description: Convert a reader lock on an existing Synchronizer entry to a writer lock
[Expand]
function SynchronizerReaderConvertEx(Synchronizer:TSynchronizerHandle; Timeout:LongWord):LongWord;
Description: Convert a reader lock on an existing Synchronizer entry to a writer lock
[Expand]
function SynchronizerWriterCount(Synchronizer:TSynchronizerHandle):LongWord;
Description: Get the current writer count of an existing Synchronizer entry
[Expand]
function SynchronizerWriterOwner(Synchronizer:TSynchronizerHandle):TThreadHandle;
Description: Get the current writer owner of an existing Synchronizer entry
[Expand]
function SynchronizerWriterLock(Synchronizer:TSynchronizerHandle):LongWord;
Description: Lock an existing Synchronizer entry for writing
[Expand]
function SynchronizerWriterLockEx(Synchronizer:TSynchronizerHandle; Timeout:LongWord):LongWord;
Description: Lock an existing Synchronizer entry for writing
[Expand]
function SynchronizerWriterUnlock(Synchronizer:TSynchronizerHandle):LongWord;
Description: Unlock an existing Synchronizer entry
[Expand]
function SynchronizerWriterConvert(Synchronizer:TSynchronizerHandle):LongWord;
Description: Convert a writer lock on an existing Synchronizer entry to a reader lock
Return to Unit Reference