Next: Formal Binding, Previous: Component on, Up: Component Declarative Statements [Contents][Index]
blockingThe blocking keyword is a declarative statement that can be used
in a component.
blocking ::= "blocking" statement
Using blocking requires an explicit reply. It can only be
used in a component. If the reply is omitted for the
blocking trigger, the imperative statement of another
trigger must perform the reply for the blocked port.
Thus, time and value of a blocked port reply depend on another
trigger. blocking may be used once in the declarative
prefix.
Only provides ports are affected by blocking. A call of a
provides port in-event will not return before a reply is
performed for that port.
Guards or on is commutative with respect to blocking. If
blocking appears before a guard or on it applies
to the imperative statement after the guard or on.
- When
blockingis used in component which is not the top component in a system and the system has multipleprovides ports, the system must be verified for deadlocks. Merely verifying all individual components is not enough.- Systems containing
blockingcomponent instances must be contained in a thread-safe shell (see Thread-safe Shell).
For example:
on trigger (): blocking imperative-statement; (1)
blocking on trigger (): imperative-statement; (2)
on trigger (): blocking [guard] imperative-statement; (3)
on trigger ():
{
blocking [guard] imperative-statement1; (4)
[guard] imperative-statement2;
}
Explanation:
2) The blocking keyword applies to the
imperative-statement following on trigger:. This form is
semantically equivalent to 1).
3) The blocking keyword applies to the imperative-statement
following [guard]. This form is semantically equivalent to
on trigger (): [guard] blocking imperative-statement;"
4) The blocking keyword applies to imperative-statement1.
It does not apply to imperative-statement2.
Next: Formal Binding, Previous: Component on, Up: Component Declarative Statements [Contents][Index]