Local continuations
[Pt]

Collaboration diagram for Local continuations:

Files

file  lc-addrlabels.h
file  lc-switch.h
file  lc.h

Defines

#define LC_INIT(s)   s = NULL
#define LC_RESUME(s)
#define LC_SET(s)   do { ({ __label__ resume; resume: (s) = &&resume; }); }while(0)
#define LC_END(s)
#define __LC_SWTICH_H__
#define LC_INIT(s)   s = 0;
#define LC_RESUME(s)   switch(s) { case 0:
#define LC_SET(s)   s = __LINE__; case __LINE__:
#define LC_END(s)   }

Typedefs

typedef void * lc_t
typedef unsigned short lc_t

Detailed Description

Local continuations form the basis for implementing protothreads. A local continuation can be set in a specific function to capture the state of the function. After a local continuation has been set can be resumed in order to restore the state of the function at the point where the local continuation was set.


Define Documentation

#define __LC_SWTICH_H__
#define LC_END (  )     }
#define LC_END (  ) 
#define LC_INIT (  )     s = 0;
#define LC_INIT (  )     s = NULL
#define LC_RESUME (  )     switch(s) { case 0:
#define LC_RESUME (  ) 
Value:
do {                                          \
    if(s != NULL) {                             \
      goto *s;                                  \
    }                                           \
  } while(0)
#define LC_SET (  )     s = __LINE__; case __LINE__:
#define LC_SET (  )     do { ({ __label__ resume; resume: (s) = &&resume; }); }while(0)

Typedef Documentation

typedef unsigned short lc_t
typedef void* lc_t

Generated on 22 Jan 2016 for MIDIboxNG by  doxygen 1.6.1