비주얼 스튜디오 C++ 내가 스레드를 사용하고 2008멀티 스레드
. 그러나, 나는이 경고를 가지고 있고 내가 뭘 잘못하고 있는지 확신하지 못한다. 당신이 _beginthreadex
에 전달
1. unsigned int (__stdcall *)(void *) differs in levels of indirection from 'void *(__stdcall *)(void *)'
2. _beginthreadex different types for formal and actual parameters 3
/* Function prototype */
void* WINAPI get_info(void *arg_list)
DWORD thread_hd;
DWORD thread_id;
/* Value to pass to the function */
int th_sock_desc = 0;
/* Create thread */
thread_hd = _beginthreadex(NULL, 0, get_info, (void*) th_sock_desc, 0, &thread_id);
if(thread_hd == 0)
{
/* Failed to create thread */
fprintf(stderr, "[ %s ] [ %s ] [ %d ]\n", strerror(errno), __func__, __LINE__);
return 1;
}
(void *) th_sock_desc -> & th_sock_desc? –
반환 값에 대해 CloseHandle()을 호출해야합니다. boost :: thread는 더 나은 쥐덫 일 수 있습니다. –