| | 711 | {{{ |
| | 712 | $system void $yield(); |
| | 713 | }}} |
| | 714 | |
| | 715 | The yield function is used inside an atomic or local region to release the atomic lock so that other processes may execute. |
| | 716 | The yielding process retains its current atomic lock multiplicity, so that if and when it regains the atomic lock, it proceeds executing |
| | 717 | with the same multiplicity it had before the yield. |
| | 718 | In order for the yielding process to return from the call to `$yield`, and thereby regain the atomic lock, the first statement following |
| | 719 | `$yield` must be enabled. |
| | 720 | This statement behaves as a guard for regaining the atomic lock, just as the first statement of an atomic block, or the first statement |
| | 721 | following `$local_start()`, acts as a guard for entering an atomic or local region. |
| | 722 | The yielding process competes with other processes to obtain the lock; it does not have any special priority. |
| | 723 | In particular, if the lock is available and there is a process at a `$local_start()` call (and the first statement following the call is enabled), one such a process is guaranteed to obtain the lock. |
| | 724 | |