Contiki 2.5
process.h File Reference

Header file for the Contiki process interface. More...

#include "sys/pt.h"
#include "sys/cc.h"

Go to the source code of this file.

Macros

Return values
#define PROCESS_ERR_OK   0
 Return value indicating that an operation was successful. More...
 
#define PROCESS_ERR_FULL   1
 Return value indicating that the event queue was full. More...
 
Process protothread functions
#define PROCESS_BEGIN()
 Define the beginning of a process. More...
 
#define PROCESS_END()
 Define the end of a process. More...
 
#define PROCESS_WAIT_EVENT()
 Wait for an event to be posted to the process. More...
 
#define PROCESS_WAIT_EVENT_UNTIL(c)
 Wait for an event to be posted to the process, with an extra condition. More...
 
#define PROCESS_YIELD()
 Yield the currently running process.
 
#define PROCESS_YIELD_UNTIL(c)
 Yield the currently running process until a condition occurs. More...
 
#define PROCESS_WAIT_UNTIL(c)
 Wait for a condition to occur. More...
 
#define PROCESS_WAIT_WHILE(c)   PT_WAIT_WHILE(process_pt, c)
 
#define PROCESS_EXIT()
 Exit the currently running process.
 
#define PROCESS_PT_SPAWN(pt, thread)
 Spawn a protothread from the process. More...
 
#define PROCESS_PAUSE()
 Yield the process for a short while. More...
 
Poll and exit handlers
#define PROCESS_POLLHANDLER(handler)
 Specify an action when a process is polled. More...
 
#define PROCESS_EXITHANDLER(handler)
 Specify an action when a process exits. More...
 
Process declaration and definition
#define PROCESS_THREAD(name, ev, data)
 Define the body of a process. More...
 
#define PROCESS_NAME(name)
 Declare the name of a process. More...
 
#define PROCESS(name, strname)
 Declare a process. More...
 

Functions

Functions called from device drivers
void process_poll (struct process *p)
 Request a process to be polled. More...
 
Functions called by the system and boot-up code
void process_init (void)
 Initialize the process module. More...
 
int process_run (void)
 Run the system once - call poll handlers and process one event. More...
 
int process_is_running (struct process *p)
 Check if a process is running. More...
 
int process_nevents (void)
 Number of events waiting to be processed. More...
 

Functions called from application programs

#define PROCESS_CURRENT()
 Get a pointer to the currently running process. More...
 
#define PROCESS_CONTEXT_BEGIN(p)
 Switch context to another process. More...
 
#define PROCESS_CONTEXT_END(p)   process_current = tmp_current; }
 End a context switch. More...
 
CCIF struct process * process_current
 
void process_start (struct process *p, const char *arg)
 Start a process. More...
 
int process_post (struct process *p, process_event_t ev, void *data)
 Post an asynchronous event. More...
 
void process_post_synch (struct process *p, process_event_t ev, void *data)
 Post a synchronous event to a process. More...
 
void process_exit (struct process *p)
 Cause a process to exit. More...
 
process_event_t process_alloc_event (void)
 Allocate a global event number. More...
 

Detailed Description

Header file for the Contiki process interface.

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

Definition in file process.h.