In this case, instead of invoking the receive activity in the main scope, we have to raise a fault in the event handler.
在这种情况下,不要调用主范围中的接收活动,而必须在事件处理程序中引发一个错误。
Finally, check whether the global counter reached zero, and if so, invoke the receive activity waiting in the main scope.
最后,检查全局计数器是否已达到零,如果是,调用主范围中等待的接收活动。
By doing so, the loop in the main scope and logic in the event handler controls the final number of event handler instances.
这样,主范围内的循环和事件处理程序中的逻辑就可以控制事件处理程序的最终数目。
In main. In a different scope.
在main中,在一个不同的区域中。
应用推荐