Description ​
TThreadPersistent extends TNotifiablePersistent by providing critical-section locking methods (Lock and Unlock). This ensures thread-safe access to graphics surfaces and data structures across concurrent threads.
WARNING
Inheriting from TThreadPersistent does not automatically make an object thread safe. TThreadPersistent merely provides a locking mechanism that you can employ to make your code thread safe.
Likewise, even though many Graphics32 classes inherit from TThreadPersistent, use of these classes are not inherently thread safe.
Constructors ​
| Name | Description |
|---|---|
| Create | Initializes a new instance of TThreadPersistent and creates its internal critical section. |
Methods ​
| Name | Description |
|---|---|
| Lock | Acquires the internal critical section lock. |
| Unlock | Releases the internal critical section lock. |
Properties ​
| Name | Type | Scope | Description |
|---|---|---|---|
| LockCount | Integer | Protected | Returns the current recursion level of critical section locks. |