Parallelism-IncorrectCriticalRegion

Critical regions must obey certain layout rules

Required inputs: IR

Possible Messages

This rule has no predefined messages.

Options

check_all_statement_sequences

check_all_statement_sequences : bool = False

If set to True, all statement sequence inside routine definitions are checked for correct pairing individually, otherwise only the top-level statement sequence is checked.
 

enter_critical_functions

enter_critical_functions

Type: set[bauhaus.analysis.config.QualifiedName]

Default: {'EnterCriticalSection', 'mtx_lock', 'pthread_mutex_lock', 'std::_Mutex_base::lock', 'std::mutex::lock'}

Set of function names to enter a critical region.
 

enter_critical_macros

enter_critical_macros : set[bauhaus.analysis.config.MacroName] = set()

Set of macro names to enter a critical region (macros must expand to asm() statement).
 

exit_critical_functions

exit_critical_functions

Type: set[bauhaus.analysis.config.QualifiedName]

Default: {'ExitCriticalSection', 'mtx_unlock', 'pthread_mutex_unlock', 'std::_Mutex_base::unlock', 'std::mutex::unlock'}

Set of function names to exit a critical region.
 

exit_critical_macros

exit_critical_macros : set[bauhaus.analysis.config.MacroName] = set()

Set of macro names to exit a critical region (macros must expand to asm() statement).
 

nested_critical_regions

nested_critical_regions : bool = True

If set to true, critical regions nest; if set to false, a single exit-critical-region terminates all open critical regions.
 

treat_enter_exit_functions_as_simple_names

treat_enter_exit_functions_as_simple_names : bool = False

Special option to fall back to the behavior of this rule from version before 7.6.6: The types of the options enter_critical_functions and exit_critical_functions were modified to accept qualified function names, e.g. critical::enter for a C++ function enter() inside of a namespace critical. Previously, these options accepted only simple names (enter) and matched this to all functions with that simple name, potentially including a separate C++ function critical2::enter(). If this project's config relied on that effect, please update the configuration to include all qualified names, or set this option to true to fall back to the old behavior.