Contiki 2.6

Local continuations

Local continuations form the basis for implementing protothreads. More...

Files

file  lc-addrlabels.h
 

Implementation of local continuations based on the "Labels as values" feature of gcc.


file  lc-switch.h
 

Implementation of local continuations based on switch() statement.


Defines

#define LC_INIT(lc)
 Initialize a local continuation.
#define LC_SET(lc)
 Set a local continuation.
#define LC_RESUME(lc)
 Resume a local continuation.
#define LC_END(lc)
 Mark the end of local continuation usage.

Typedefs

typedef void * lc_t
 The local continuation type.

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_END (   lc)

Mark the end of local continuation usage.

The end operation signifies that local continuations should not be used any more in the function. This operation is not needed for most implementations of local continuation, but is required by a few implementations.

Definition at line 108 of file lc.h.

#define LC_INIT (   lc)

Initialize a local continuation.

This operation initializes the local continuation, thereby unsetting any previously set continuation state.

Definition at line 71 of file lc.h.

#define LC_RESUME (   lc)

Resume a local continuation.

The resume operation resumes a previously set local continuation, thus restoring the state in which the function was when the local continuation was set. If the local continuation has not been previously set, the resume operation does nothing.

Definition at line 96 of file lc.h.

#define LC_SET (   lc)

Set a local continuation.

The set operation saves the state of the function at the point where the operation is executed. As far as the set operation is concerned, the state of the function does not include the call-stack or local (automatic) variables, but only the program counter and such CPU registers that needs to be saved.

Definition at line 84 of file lc.h.