Starts checking for freezes and hangs.
Unit
EFreeze
Syntax
Code (Delphi)
|
procedure InitCheckFreeze(
const AThreadID: Cardinal = 0;
const AMainWnd: HWND = 0;
const AThreadHandle: THandle = 0;
const ATimeout: Cardinal = 4;
const AAntiFreezeMsg: String = '';
const AAntiFreezeWCTMsg: String = ''
);
|
Parameters
AThreadID [in, optional]
Thread ID to detect hangs inside this thread. Usually this is MainThreadID. Default is 0 - which means "use MainThreadID". This value can be ignored by some checks. For example, Wait Chain Traversal (WCT) check detects deadlocks in any EurekaLog-enabled threads - thus it does not need thread ID.
AMainWnd [in, optional]
A handle of main application form. Default is 0 - which means autodetection. This value can be ignored by some checks. For example, Wait Chain Traversal (WCT) check detects deadlocks in any EurekaLog-enabled threads - thus it does not need window handle.
AThreadHandle [in, optional]
A handle of thread identified by AThreadID.
ATimeout [in, optional]
A timeout in seconds. Default is 4. It is recommended to pass CurrentEurekaLogOptions.FreezeTimeout here.
AAntiFreezeMsg [in, optional]
A message for freeze exception. Default is 'The application seems to be frozen.'. It is recommended to pass CurrentEurekaLogOptions.CustomizedExpandedTexts[mtException_AntiFreeze] here.
AAntiFreezeWCTMsg [in, optional]
Alternative message for freeze exception. Default is 'A deadlock was detected in thread %d.'. It is recommended to pass CurrentEurekaLogOptions.CustomizedExpandedTexts[mtException_AntiFreezeWCT] here.
Remarks
This function creates a background freeze detection thread. Thread will use current EurekaLog options.
The function will use FreezeThreadClass global variable to determinate which class should be used as background freeze detection thread.
Important!
|
This function should be called from main thread.
|
Note
|
This function is called automatically during initialization of EurekaLog. You can call it manually to re-create/re-initialize freeze detection checks. For example, if you want to change timeout at run-time.
The function will not be called automatically if hang detection is disabled in EurekaLog project options.
|
Warning
|
This function do nothing if freeze detection thread is already running. Use DoneCheckFreeze to stop background freeze detection thread.
|
Note
|
This function will do nothing if your current settings blocks freeze detection. For example, if your settings indicate that freeze detection should not be active during debugging, and you currently run application under debugging - then this call will do nothing.
|
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_initcheckfreeze.php
|
|