Root > Reference > All Functions > EndThreadEx

Procedure EndThreadEx

Previous pageReturn to chapter overviewNext page   

Terminates the execution of a thread.







Code (Delphi)

procedure EndThreadEx(

const AExitCode: Integer = 0




AExitCode [in, opt]

An optional thread exit code (thread termination status).


Return value

The function does NOT return.





We do not recommend to use any of the following functions: EndThreadEx, EndThread, ExitThread. Just exit from thread's proc normally to ensure proper cleanup of allocated resources. Using any of the mentioned functions can cause memory leaks if you don't know what you are doing.


You can use this function instead of EndThread function inside threads created with BeginThreadEx.


EndThreadEx notifies EurekaLog about thread's termination and terminates the execution of a thread with the specified ExitCode.



On Windows, EndThreadEx calls the ExitThread WinAPI with the specified ExitCode.


See also

Send feedback... Build date: 2022-03-28
Last edited: 2022-03-28
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: