Jump to content

Ada Programming/Attributes/'Count

From Wikibooks, open books for an open world

Ada. Time-tested, safe and secure.
Ada. Time-tested, safe and secure.

Description

[edit | edit source]

X'Count is an Ada attribute where X is an entry point in a protected type. This attribute returns the number of tasks currently enqueued waiting for entrance into the entry procedure.

Example

[edit | edit source]
protected type My_Protected_Type is
  entry My_Entry;
  procedure Get_Count( Task_Count : out Natural );
end My_Protected_Type;
...
procedure body Get_Count( Task_Count : out Natural ) is begin
  Task_Count := My_Entry'Count;
end Get_Count;

See also

[edit | edit source]

Wikibook

[edit | edit source]

Ada Reference Manual

[edit | edit source]