Helixis 1.0
Task Programming API
Data Structures | Defines | Functions
sources/internal_includes/native/native_channels.h File Reference

Go to the source code of this file.

Data Structures

union  _hlx_channel_data
struct  _hlx_channel
struct  _hlx_channel_manager

Defines

#define HLX_CHAN_AVAILABLE   (0)
#define HLX_CHAN_FILLED   (3)
#define HLX_CHAN_WRITE_GENERATOR(name, type, union_var)
#define HLX_CHAN_READ_GENERATOR(name, type, union_var)

Functions

void _init_channel_manager (void)
void _destroy_channel_manager (void)

Define Documentation

#define HLX_CHAN_AVAILABLE   (0)

Definition at line 40 of file native_channels.h.

Referenced by hlx_chan_create().

#define HLX_CHAN_FILLED   (3)

Definition at line 41 of file native_channels.h.

#define HLX_CHAN_READ_GENERATOR (   name,
  type,
  union_var 
)
Value:
int             __hlx_chan_read_##name(unsigned long id, type* value)   \
{       \
        hlx_list_node           *node;  \
        _hlx_channel            *chan;  \
        \
        if ((node = _hlx_get_channel_by_hash(id)) == 0) \
           return (0);  \
    chan = (_hlx_channel *)node->data;  \
    if (chan->status != HLX_CHAN_FILLED)        \
       return (0);      \
    *value = chan->data.union_var;      \
    chan->status = HLX_CHAN_AVAILABLE;  \
    return (1); \
}

Definition at line 59 of file native_channels.h.

#define HLX_CHAN_WRITE_GENERATOR (   name,
  type,
  union_var 
)
Value:
int             __hlx_chan_write_##name(unsigned long id, type value)   \
{       \
        hlx_list_node           *node;  \
        _hlx_channel            *chan;  \
        \
        if ((node = _hlx_get_channel_by_hash(id)) == 0) \
           return (0);  \
    chan = (_hlx_channel *)node->data;  \
        if (chan->status != HLX_CHAN_AVAILABLE) \
           return (0);  \
        chan->data.union_var = value;   \
    chan->status = HLX_CHAN_FILLED;     \
        return (1);     \
}

Definition at line 43 of file native_channels.h.


Function Documentation

void _destroy_channel_manager ( void  )
void _init_channel_manager ( void  )

Definition at line 102 of file parallel_channels.c.

References _hlx_channel_manager::channels, and slist_new().

Referenced by hlx_core_init().

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines