是否保证等待条件为真时只执行一次回调?

Is it guaranteed that only one callback is executed when the wait condition is true?

这是关于声明 WAIT FOR ASYNCHRONOUS TASKS 和文档的相应部分:

If the result of log_exp is false and there is an asynchronous function call with callback routine, the program waits until a callback routine of a previous function (called asynchronously) has been executed and then checks the logical expression again:

假设我生成了 4 个任务,每个任务将 availability 属性减一,达到 0。在回调中,它们将 availability 属性增加一。
现在,当我到达 WAIT FOR ASYNCHRONOUS TASKS UNTIL availability > 0 UP TO 6000 SECONDS. 时,程序会一直等待,直到计数器通过回调增加。

问题:再次检查逻辑表达式时,是否保证顺序为

callback->check->callback->check?

或者 availability 例如已经 3 个了,因为它

callback->callback->callback->check?

它按照文档工作。

等待 -> 回调 -> 检查,等待 -> 回调 -> 检查,
直到等待条件为真或没有更多未完成的回调打开。

重要的是回调 form/method 在执行检查之前完成,因为该例程负责更改 WAIT UNTIL 条件中的 variable/s。

文档摘录。

If the result of log_exp is false and there is an asynchronous function call with callback routine, the program waits until a callback routine of a previous function (called asynchronously) has been executed and then checks the logical expression again:

如果您担心同时发生 2 个回调, 回调由内核按顺序处理。 不保证顺序,只是按顺序处理回调。请注意,等待程序一次只能在 1 个工作进程中执行。从我的测试来看,它总是相同的工作流程。