Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detach a thread on Windows C++

How to detach a thread on windows in C++. On Posix we have pthread_detach(pthread_self());. How to achieve this in windows enviornment.

like image 796
Avinash Avatar asked Oct 05 '12 10:10

Avinash


1 Answers

Assuming that you are using _beginthreadex or CreateThread to create the thread, you just need to close the thread handle using CloseHandle.

like image 72
cmeerw Avatar answered Oct 14 '22 19:10

cmeerw