reactor-c 1.0
C Runtime for Lingua Franca
Loading...
Searching...
No Matches
lf_async_state_t Struct Reference

State of a pending lf_async() call. More...

#include <reactor.h>

Data Fields

lf_action_base_t * action
 The action that resumes this call, or NULL for lf_await(), which is resumed by lf_await_resume().
bool event_pending
 True if this call scheduled the logical action for resume_tag.
bool function_done
 Set to true in _lf_async_end(), once the invoked function has returned.
bool left_pool
 True if the calling thread left the pool of worker threads.
struct lf_async_state_t * next
 Next pending call in the environment, or NULL.
lf_port_base_t * port
 The input port passed to lf_await(), or NULL for lf_async().
reaction_t * reaction
 The reaction that invoked lf_async().
tag_t resume_tag
 Tag at which a logical action resumes this call.
bool resume_waiting
 Set to true by lf_async_resume() when it is waiting for function_done.
bool resumed
 Set to true when the call has been resumed.
lf_cond_t resumed_cond
 Signaled when resumed becomes true.
self_base_t * self
 The reactor whose reaction invoked lf_async().

Detailed Description

State of a pending lf_async() call.

An instance of this struct lives on the stack of the reaction that invoked lf_async(). While the call is waiting to be resumed, the instance is linked into the list of pending calls of the environment (see environment_t::async_waiters). All fields other than resumed_cond are protected by the environment mutex once the instance is on that list.

Field Documentation

◆ action

lf_action_base_t* lf_async_state_t::action

The action that resumes this call, or NULL for lf_await(), which is resumed by lf_await_resume().

A physical action is scheduled in _lf_async_end().

◆ event_pending

bool lf_async_state_t::event_pending

True if this call scheduled the logical action for resume_tag.

A later call for the same action and tag leaves this false and does not schedule another event.

◆ function_done

bool lf_async_state_t::function_done

Set to true in _lf_async_end(), once the invoked function has returned.

◆ left_pool

bool lf_async_state_t::left_pool

True if the calling thread left the pool of worker threads.

This is false if the program was already stopping when the call began, in which case the call does not suspend at all.

◆ next

struct lf_async_state_t* lf_async_state_t::next

Next pending call in the environment, or NULL.

◆ port

lf_port_base_t* lf_async_state_t::port

The input port passed to lf_await(), or NULL for lf_async().

◆ reaction

reaction_t* lf_async_state_t::reaction

The reaction that invoked lf_async().

Restored as the executing reaction upon resumption.

◆ resume_tag

tag_t lf_async_state_t::resume_tag

Tag at which a logical action resumes this call.

FOREVER_TAG for a physical action and for lf_await(). Several calls that share one logical action and the same tag share one event.

◆ resume_waiting

bool lf_async_state_t::resume_waiting

Set to true by lf_async_resume() when it is waiting for function_done.

◆ resumed

bool lf_async_state_t::resumed

Set to true when the call has been resumed.

◆ resumed_cond

lf_cond_t lf_async_state_t::resumed_cond

Signaled when resumed becomes true.

Associated with the environment mutex.

◆ self

self_base_t* lf_async_state_t::self

The reactor whose reaction invoked lf_async().


The documentation for this struct was generated from the following file:
  • /Users/runner/work/reactor-c/reactor-c/include/core/reactor.h