• Thread_Timer_Queue_Test - timer cancellation

    From gkruchio@gmail.com@21:1/5 to All on Mon Feb 13 02:06:04 2017
    reading the code of Thread_Timer_Queue_Test I can not find the deallocation of the Handler object if the timer is canceled.

    I understand:

    - Input_Task::add_timer() allocates a Handler and gives the Handler* pointer to Thread_Timer_Queue by calling its Thread_Timer_Queue::schedule() method

    - in case of timer expiration Handler::handle_timeout() hook is called and the Handler is deleted

    - in case of timer cancellation Thread_Timer_Queue::cancel() will be called.

    I do *not* understand how Handler is deleted if Thread_Timer_Queue::cancel() is called before timer expiration.

    Thank you: Gabor

    I am referencing the following sources: http://www.dre.vanderbilt.edu/~schmidt/DOC_ROOT/ACE/examples/Timer_Queue/Thread_Timer_Queue_Test.h

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)