Перехожу сразу к делу.
Я создаю несколько потоков с помощью CreateThread. И все нормально пока не начинаю их закрывать
Короче, может кто сталкивался с данной проблемой?
Заранее спасибо








Prickly писал(а):...Суть в том, что закрыв потоки (TerminateThread) я не могу выгрузить свою программу стандартными методами...

Antonariy
Прочитай внимательно вопрос, пожалуйста. Обратив особое внимание на слова, заключённые там в скобки.


MSDN писал(а):TerminateThread is used to cause a thread to exit. When this occurs, the target thread has no chance to execute any user-mode code and its initial stack is not deallocated. DLLs attached to the thread are not notified that the thread is terminating.
TerminateThread is a dangerous function that should only be used in the most extreme cases. You should call TerminateThread only if you know exactly what the target thread is doing, and you control all of the code that the target thread could possibly be running at the time of the termination. For example, TerminateThread can result in the following problems:
- If the target thread owns a critical section, the critical section will not be released.
- If the target thread is executing certain kernel32 calls when it is terminated, the kernel32 state for the thread's process could be inconsistent.
- If the target thread is manipulating the global state of a shared DLL, the state of the DLL could be destroyed, affecting other users of the DLL.

Сейчас этот форум просматривают: AhrefsBot и гости: 10