DWORD WINAPI Thread_InputData(LPVOID lpParameter) {
}
DWORD WINAPI Thread_GetH264(LPVOID lpParameter) {
}
int main(){
HANDLE thread_inoutdata = CreateThread(NULL, 0, Thread_InputData, NULL, 0, NULL);
HANDLE thread_geth264 = CreateThread(NULL, 0, Thread_GetH264, NULL, 0, NULL);
WaitForSingleObject(thread_inoutdata, INFINITE);
WaitForSingleObject(thread_geth264,INFINITE);
}
1.WaitForSingleObject等待子线程退出后,主线程才退出
2.windows中的主线程一旦退出,子线程便会退出,因此要调用WaitForSingleObject方法(android中主线程退出后,子线程继续运行)