#include <etimer/chEtimer.h>int timerThreadPoolWait(KnThreadPool *threadPool, void **cookie, int *overrun, KnTimeVal *waitLimit);
The function or functions documented here may not be used safely in all application contexts with all APIs provided in the ChorusOS 5.0 product.
See API(5FEA) for details.
timerThreadPoolWait() waits for a subsequent timer expiration in a timer that was created using the thread pool threadPool (see timerCreate(2K)). When an expiration event occurs and the current thread is selected among those waiting in the thread pool, it will return from timerThreadPoolWait(). On return, cookie will contain the cookie value provided at the creation of the corresponding timer and overrun will contain the overrun count corresponding to the current expiration.
Until this type of timer event occurs, the current thread is blocked according to the waitLimit specification (see intro(2K)).
threadPool must have been previously initialized using timerThreadPoolInit(2K).
Only one thread at a time may be active on behalf of a single timer. Thus, during the interval between a thread's return from timerThreadPoolWait() and its next invocation of timerThreadPoolWait(), no other thread will be awakened for an expiration of the same timer. The expiration will be counted as a timer overrun.
A timer expiration which occurs when there are no threads currently waiting for the associated thread pool is also counted as an overrun. A positive overrun count indicates that at least one timeout notification for the timer was delayed. An overrun count greater than 1 indicates that at least one timeout notification was lost, that is, no waiting threads could be awakened by the expiration event.
Each time a thread returns from timerThreadPoolWait(), the current overrun count for the corresponding timer is stored in overrun and the timer's internal overrun count is reset to zero. Thus, the overrun count delivered with each event notification represents only the number of delayed or lost expirations since the last notification.
On successful completion, K_OK is returned. Otherwise, a negative error code is returned.
threadPool is not an initialized thread pool object.
An address argument falls outside the caller's address space.
See attributes(5) for descriptions of the following attributes:
|ATTRIBUTE TYPE||ATTRIBUTE VALUE|