I read the documentation about _beginthreadexand _endthreadex, but there are a few things that I do not understand.
_beginthreadex
_endthreadex
Note that the documentation continues to document "advanced" and normal functions at the same time, but I do not use _beginthreadand _endthread; only their extended versions.
_beginthread
_endthread
You can call _endthread or _endthreadex explicitly to terminate the thread; however, _endthread or _endthreadex is called automatically when the thread returns from the procedure passed as a parameter. Terminating a thread with an endthread or _endthreadex call helps ensure proper recovery of resources allocated to the thread.
_endthread automatically closes the thread descriptor (whereas _endthreadex does not). Therefore, when using _beginthread and _endthread, explicitly do not close the thread descriptor by calling the Win32 CloseHandle API.
CloseHandle
All my flows only voluntarily cease, returning from their main function and never cease. According to the documentation, when this happens, it is _endthreadexcalled automatically.
. , , , , ? - ? , ?
_endthreadex , , " "? , , ?
, , .
_endthreadex , CloseHandle?
_endthreadex CloseHandle. , _endthread (, , CloseHandle ).
, . , _endthreadex .
, , . ( WaitForSingleObject), . , . , , .
WaitForSingleObject
Source: https://habr.com/ru/post/1769918/More articles:Website page layout width - htmlMany-page form - javascriptEXC_BAD_ACCESS if I call an Objective-C block directly - objective-cExecuting multiple MySQL queries in a single query? - mysqlTranslucent PictureBox (C # application for Windows Forms) - c #Trying to "sync" 2 html tables (apply column widths) - jquerySanitizing MySQL queries without pre-invariants (PHP + old mysql module) - phpActionScript 3: Dynamically add container-restricted movie clips - actionscript$ is the name of the vs function - oopИспользование CGContextDrawTiledImage при различных масштабах приводит к огромному росту памяти - iphoneAll Articles