Root > Reference > All Functions > FreezeNotifyStillAlive

Procedure FreezeNotifyStillAlive

Previous pageReturn to chapter overviewNext page   

Lets EurekaLog know that your main thread is still working.

 

Unit

EFreeze

 

Syntax

 

Code (Delphi)

procedure FreezeNotifyStillAlive;

 

Remarks

This function will temporarily stop freeze detection without shutdowning background freeze detection thread.

 

EurekaLog tries to send messages to main thread from time to time. If your main thread is busy or hang - it will not process the messages, therefore EurekaLog will trigger "The thread appears to be frozen" error. Calling this function will skip a single check for main thread's responsivness, so EurekaLog will know that your thread is OK, even though it is not processing messages.

 

Warning

FreezeNotifyStillAlive should be called frequently. Imagine you have notified our freeze checks that your thread is alive. OK, sure: our checks will receive the message and skip a single check. Next, your thread will do something long. Now you are not sending "I am still alive" messages. Our checks will trigger immediately on the next closest check, because your thread is not responding for messages nor we did not receive "I'm still alive" notification.

 

Tip

For the above reason we recommend to use PauseFreezeCheck instead.

 

It is usually better to just let main thread process messages instead of calling this function. If it is not possible - consider offloading work into a background thread. You can even do this:

Code (Delphi)

Thread := TThread.Create(True);

Thread.Start;

if WaitForSingleObject(Thread.Handle, YourMaxExecutionTimeInMS) = WAIT_TIMEOUT then

RaiseFreezeException(Thread.ThreadID, Thread.Handle);

 

 

Important!

FreezeNotifyStillAlive can be called only by main thread.

 

See also




Send feedback... Build date: 2024-09-30
Last edited: 2024-09-30
PRIVACY STATEMENT
The documentation team uses the feedback submitted to improve the EurekaLog documentation. We do not use your e-mail address for any other purpose. We will remove your e-mail address from our system after the issue you are reporting has been resolved. While we are working to resolve this issue, we may send you an e-mail message to request more information about your feedback. After the issues have been addressed, we may send you an email message to let you know that your feedback has been addressed.


Permanent link to this article: https://www.eurekalog.com/help/eurekalog/topic_function_efreeze_freezenotifystillalive.php