New function process_nevents().

This commit is contained in:
bg- 2006-08-17 15:39:24 +00:00
parent b065b27759
commit e4e3a11b8b
2 changed files with 21 additions and 3 deletions

View File

@ -28,7 +28,7 @@
*
* This file is part of the Contiki operating system.
*
* @(#)$Id: process.c,v 1.1 2006/06/17 22:41:20 adamdunkels Exp $
* @(#)$Id: process.c,v 1.2 2006/08/17 15:39:24 bg- Exp $
*/
/**
@ -353,6 +353,16 @@ process_run(void)
}
/*---------------------------------------------------------------------------*/
int
process_nevents(void)
{
#ifdef NPOLLS
return nevents + npolls;
#else
return nevents + poll_requested;
#endif
}
/*---------------------------------------------------------------------------*/
int
process_post(struct process *p, process_event_t ev, process_data_t data)
{
static unsigned char snum;

View File

@ -28,7 +28,7 @@
*
* This file is part of the Contiki operating system.
*
* @(#)$Id: process.h,v 1.1 2006/06/17 22:41:20 adamdunkels Exp $
* @(#)$Id: process.h,v 1.2 2006/08/17 15:39:25 bg- Exp $
*/
/**
@ -503,7 +503,7 @@ void process_init(void);
* Run the system once - call poll handlers and process one event.
*
* This function should be called repeatedly from the main() program
* to actuall run the Contiki system. It calls the necessary poll
* to actually run the Contiki system. It calls the necessary poll
* handlers, and processes one event. The function returns the number
* of events that are waiting in the event queue so that the caller
* may choose to put the CPU to sleep when there are no pending
@ -514,6 +514,14 @@ void process_init(void);
*/
int process_run(void);
/**
* Number of events waiting to be processed.
*
* \return The number of events that are currently waiting to be
* processed.
*/
int process_nevents(void);
/** @} */
extern struct process *process_list;