hello,
I have created a thread to launch an FTP file removal process, and I need the thread to run while my other program functions are running. Then, before my functions complete and return, I need to check the thread to make sure that it is done before I return from the functions and close the thread handle. Here is a sample of what I am doing
HANDLE m_pThread =::CreateThread( NULL,0,LPTHREAD_START_ROUTINE)LogFileThread,this,0
,&threadID);
//Need to make sure that the thread is running while the other processes are running. (Not sure what to do here)
//perform other functions here while the thread is running and doing its stuff (I have these functions already written)
//check the thread to see if it has finished its processes (this is where I am having the problem)
//If the thread has finished, return from the body of the program, if not, wait for the thread to finish.
Anyone have any ideas?
I have created a thread to launch an FTP file removal process, and I need the thread to run while my other program functions are running. Then, before my functions complete and return, I need to check the thread to make sure that it is done before I return from the functions and close the thread handle. Here is a sample of what I am doing
HANDLE m_pThread =::CreateThread( NULL,0,LPTHREAD_START_ROUTINE)LogFileThread,this,0
,&threadID);
//Need to make sure that the thread is running while the other processes are running. (Not sure what to do here)
//perform other functions here while the thread is running and doing its stuff (I have these functions already written)
//check the thread to see if it has finished its processes (this is where I am having the problem)
//If the thread has finished, return from the body of the program, if not, wait for the thread to finish.
Anyone have any ideas?