Contiki-NG
Loading...
Searching...
No Matches

Implementation of local continuations based on switch() statement. More...

Go to the source code of this file.

Macros

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

Detailed Description

Implementation of local continuations based on switch() statement.

Author
Adam Dunkels adam@.nosp@m.sics.nosp@m..se

This implementation of local continuations uses the C switch() statement to resume execution of a function somewhere inside the function's body. The implementation is based on the fact that switch() statements are able to jump directly into the bodies of control structures such as if() or while() statements.

This implementation borrows heavily from Simon Tatham's coroutines implementation in C: http://www.chiark.greenend.org.uk/~sgtatham/coroutines.html

Definition in file lc-switch.h.