IntrOS
Loading...
Searching...
No Matches
List

lists of memory objects More...

Macros

#define OS_LST(lst)
 define and initialize a list object
#define static_LST(lst)
 static alias of OS_LST()
#define LST_INIT()
 create and initialize a list object
#define LST_CREATE()
 create and initialize a list object
#define LST_NEW   LST_CREATE
 alias of LST_CREATE()

Functions

void lst_init (lst_t *lst)
 initialize a list object
void lst_reset (lst_t *lst)
 wake up all waiting tasks with 'E_STOPPED' event value
void lst_kill (lst_t *lst)
 alias of lst_reset()
int lst_take (lst_t *lst, void **data)
 try to get memory object from the list object, don't wait if the list object is empty
int lst_tryWait (lst_t *lst, void **data)
 alias of lst_take()
int lst_waitFor (lst_t *lst, void **data, cnt_t delay)
 try to get memory object from the list object, wait for given duration of time while the list object is empty
int lst_waitUntil (lst_t *lst, void **data, cnt_t time)
 try to get memory object from the list object, wait until given timepoint while the list object is empty
int lst_wait (lst_t *lst, void **data)
 try to get memory object from the list object, wait indefinitely while the list object is empty
void lst_give (lst_t *lst, void *data)
 transfer memory object to the list object,

Detailed Description

lists of memory objects

Macro Definition Documentation

◆ OS_LST

#define OS_LST ( lst)
Value:
lst_t lst[] = { _LST_INIT() }

define and initialize a list object

Parameters
lstname of a pointer to list object

◆ static_LST

#define static_LST ( lst)
Value:
static lst_t lst[] = { _LST_INIT() }

static alias of OS_LST()

◆ LST_INIT

#define LST_INIT ( )
Value:
_LST_INIT()

create and initialize a list object

Returns
list object
Note
use only in 'C' code

◆ LST_CREATE

#define LST_CREATE ( )
Value:
{ LST_INIT () }
#define LST_INIT()
create and initialize a list object
Definition oslist.h:123

create and initialize a list object

Returns
list object as array (id)
Note
use only in 'C' code

Function Documentation

◆ lst_init()

void lst_init ( lst_t * lst)

initialize a list object

Parameters
lstpointer to list object

◆ lst_reset()

void lst_reset ( lst_t * lst)

wake up all waiting tasks with 'E_STOPPED' event value

Parameters
lstpointer to list object
Note
use only in thread mode

◆ lst_take()

int lst_take ( lst_t * lst,
void ** data )

try to get memory object from the list object, don't wait if the list object is empty

Parameters
lstpointer to list object
datapointer to store the pointer to the memory object
Return values
E_SUCCESSpointer to memory object was successfully transferred to the data pointer
E_TIMEOUTlist object is empty, try again

◆ lst_waitFor()

int lst_waitFor ( lst_t * lst,
void ** data,
cnt_t delay )

try to get memory object from the list object, wait for given duration of time while the list object is empty

Parameters
lstpointer to list object
datapointer to store the pointer to the memory object
delayduration of time (maximum number of ticks to wait while the list object is empty)
  • IMMEDIATE: don't wait if the list object is empty
  • INFINITE: wait indefinitely while the list object is empty
Return values
E_SUCCESSpointer to memory object was successfully transferred to the data pointer
E_STOPPEDlist object was reseted before the specified timeout expired
E_TIMEOUTlist object is empty and was not received data before the specified timeout expired

◆ lst_waitUntil()

int lst_waitUntil ( lst_t * lst,
void ** data,
cnt_t time )

try to get memory object from the list object, wait until given timepoint while the list object is empty

Parameters
lstpointer to list object
datapointer to store the pointer to the memory object
timetimepoint value
Return values
E_SUCCESSpointer to memory object was successfully transferred to the data pointer
E_STOPPEDlist object was reseted before the specified timeout expired
E_TIMEOUTlist object is empty and was not received data before the specified timeout expired

◆ lst_wait()

int lst_wait ( lst_t * lst,
void ** data )
inline

try to get memory object from the list object, wait indefinitely while the list object is empty

Parameters
lstpointer to list object
datapointer to store the pointer to the memory object
Return values
E_SUCCESSpointer to memory object was successfully transferred to the data pointer
E_STOPPEDlist object was reseted

◆ lst_give()

void lst_give ( lst_t * lst,
void * data )

transfer memory object to the list object,

Parameters
lstpointer to list object
datapointer to memory object (taken from a memory pool: the list uses the header preceding the memory object)