Waiting for a capture can be timed out, causing the capture to fail.
b) scheduled or unscheduled termination of the script handler; +\ c) expiration of the guaranteed release time specified in the component parameters. +\ d) rebooting the node or server executing the script.
Mutex Component
:icons:font :hardbreaks: :imagesdir: ../../../assets/images :toc-title: Contents :toc:
Description
Occupies or frees a critical section on the current site. It is used to block an arbitrary operation (for example, reading and modifying a site or global variable) from simultaneous execution in different instances of scripts and associated harmful mutations. Can be used as an alternative to transactions.
The component pauses script execution until an initiative is issued confirming the capture of the named critical section. +\
The critical section will be held until one of the events:
a) releasing a section in the same scenario by the same component with the action “Release”; +\
The implementation of the component limits its use to a single site. The critical section is not tied to domains, specific servers and scripts. To introduce such bindings, a key should be generated using the name of the corresponding domain and/or server.
Index |
|
Short name |
|
Script types |
|
Start module |
|
Mode |
Asynchronous |
Icon |
|
Branching type |
Branching, closing |
Properties
| Specification | Description |
|---|---|
Name: Key Code: Visibility condition: no Default: — |
An argument containing the name of the critical section. |
Name: Action Code: Visibility condition: no Default: Capture |
Selecting an action on the critical section. Possible values:
|
Name: Operation type
Code: Default: |
Select the type of operation to be blocked. Read operations may not be mutually blocked (for example, getting the value of a global variable), but modification operations (first taking the value of a global variable, then converting and then saving the global variable) require a complete lock on the critical section. Possible values:
Used for capturing. |
Name: Waiting time, ms Code: Visibility condition: yes Default: 1000 |
An argument containing a timeout in milliseconds after which the capture wait should be stopped. Control returns via the timeout branch. Used for capturing`. |
Name: Guaranteed release time, ms Code: Visibility condition: yes Default: 1000 |
An argument containing the lock holding time in milliseconds, after which the critical section is guaranteed to be freed without waiting for other events. Used for capturing. |
Name: Error in variable Code: Visibility condition: yes Default: — |
Variable to save error text if capture fails. |
Name: Transition Code: Visibility condition: no Default: — |
The component to which control is transferred upon successful completion of the operation. |
Name: Transition, time Code: Visibility condition: no Default: — |
The component to which control is transferred after the timeout for waiting for the result of the operation. |
Name: Transition, error
Code: Default: — |
Component to which control is transferred in case of an error. |