Name: critical | Association: block |
Category: executable | Properties: thread-limiting |
|
Arguments
critical(name) Name | Type | Properties |
name | base language identifier | optional |
|
Clauses
Binding
The binding thread set for a critical region is all threads in the contention group.Semantics
The name argument is used to identify the critical construct. For any critical construct for which name is not specified, the effect is as if an identical (unspecified) name was specified. The region that corresponds to a critical construct of a given name is executed as if only a single thread at a time among all threads in the contention group executes the region, without regard to the teams to which the threads belong.Execution Model Events
The critical-acquiring event occurs in a thread that encounters the critical construct on entry to the critical region before initiating synchronization for the region.The critical-acquired event occurs in a thread that encounters the critical construct after it enters the region, but before it executes the structured block of the critical region.
The critical-released event occurs in a thread that encounters the critical construct after it completes any synchronization on exit from the critical region.
Tool Callbacks
A thread dispatches a registered ompt_callback_mutex_acquire callback for each occurrence of a critical-acquiring event in that thread. This callback has the type signature ompt_callback_mutex_acquire_t.A thread dispatches a registered ompt_callback_mutex_acquired callback for each occurrence of a critical-acquired event in that thread. This callback has the type signature ompt_callback_mutex_t.
A thread dispatches a registered ompt_callback_mutex_released callback for each occurrence of a critical-released event in that thread. This callback has the type signature ompt_callback_mutex_t.
The callbacks occur in the task that encounters the critical construct. The callbacks should receive ompt_mutex_critical as their kind argument if practical, but a less specific kind is acceptable.
Restrictions
Restrictions to the critical construct are as follows:The hint-expr that is applied to each of the critical constructs with the same name must evaluate to the same value.
Cross References