Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is the TTimer.OnTimer event handler reentrant?

Tags:

I have a TTimer in my application that fires every 2 seconds and calls my event handler, HandleTimerEvent(). The HandleTimerEvent() function modifies shared resources and can take 10's of seconds to execute before returning. Furthermore, I call Sleep() in the event handler to relinquish the processor at times.

I'm not sure how C++ builder's TTimer object works when it comes to calling events, so the scenario I just explained has got me thinking, particularly, whether HandleTimerEvent() gets called before a prior call has returned.

The question comes down to a couple of things.

Does the TTimer object queue the events?

Can the TTimer object call my event handler before a prior call has returned?