TTMSMCPTaskRegistry.MarkTaskInUse Method
Protects a task from being purged while a blocking request is reading it or waiting on it.
API unit family: TMS.MCP.Tasks
Declaring type: TTMSMCPTaskRegistry
Syntax
procedure MarkTaskInUse(const ATaskId: string; AInUse: Boolean);
Remarks
Users are counted, so concurrent readers nest safely. TTMSMCPTaskRegistry.PurgeExpiredTasks skips a task that has at least one user. Does nothing when the identifier is unknown.
Parameters
| Name | Description |
|---|---|
ATaskId |
Identifier of the task to mark. |
AInUse |
True registers one more user of the task, False releases one. Every call with True must be matched by a call with False. |