New function process_nevents().
This commit is contained in:
parent
b065b27759
commit
e4e3a11b8b
|
@ -28,7 +28,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of the Contiki operating system.
|
* 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
|
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)
|
process_post(struct process *p, process_event_t ev, process_data_t data)
|
||||||
{
|
{
|
||||||
static unsigned char snum;
|
static unsigned char snum;
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of the Contiki operating system.
|
* 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.
|
* Run the system once - call poll handlers and process one event.
|
||||||
*
|
*
|
||||||
* This function should be called repeatedly from the main() program
|
* 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
|
* handlers, and processes one event. The function returns the number
|
||||||
* of events that are waiting in the event queue so that the caller
|
* 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
|
* 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);
|
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;
|
extern struct process *process_list;
|
||||||
|
|
Loading…
Reference in a new issue