2.1.3 Ao_timer Type

The rationale for the Ao_timer type is that you cannot cancel a pending e32.ao_sleep. This is problematic if e.g. the user exits an application which is sleeping. In this case a panic would occur since the sleep is not cancelled - this is the reason you should avoid using e32.ao_sleep and instead use the Ao_timer with appropriate cancel calls if there is for example a possibility for the user to exit the application during a sleep.

class Ao_timer( )
Creates an Ao_timer instance. A Symbian active object based sleeping service. This can be used in the main thread without blocking the handling of UI events. The application should not exit while a thread has a pending after call in Ao_timer. Only one after invocation can be pending at time for each instance of this type.

Instances of Ao_timer type have the following methods:

after( interval [,callback])
Sleeps for the given interval without blocking the active scheduler. When the optional callback is given, the call to after returns immediately and the callback gets called after interval.

cancel( )
Cancels a pending after call.

See About this document... for information on suggesting changes.