blob: 43f35e262b564a318f577bbfca626127c3bbb9f3 [file] [log] [blame]
Zesstra3085c662025-08-02 18:31:10 +02001NAME
2 yield
3
4SYNTAX
5 yield()
6 yield(<value>)
7 yield(<value>, <coroutine>)
8
9DESCRIPTION
10 The instruction is only allowed in a coroutine and suspends its
11 execution.
12
13 The first two forms return to the caller (i.e. the function that
14 continued the execution of the coroutine with call_coroutine()),
15 the third form resumes execution of the given coroutine, which
16 must currently be in a suspended state.
17
18 The value will be passed to the caller as the result of the
19 call_coroutine() call resp. to the target coroutine as the result
20 of its yield() instruction that suspended its execution before.
21 If the coroutine had just started, the value will be discarded.
22 In the first form, 0 will be passed to the caller.
23
24HISTORY
25 Coroutines were introduced in LDMud 3.6.5.
26
27SEE ALSO
28 coroutines(LPC), async(LPC), await(LPC), foreach(LPC),
29 call_coroutine(E), this_coroutine(E)