windows线程创建通常使用CreateThread。 此函数与CRT冲突,请尽量不要使用。 必须使用_beginthread并使用_endthread退出线程。 这两个函数可以在集中使用。
要使用这两个函数,需要包含标头#include process.h
_beginthread声明如下: acrtimpuintptr _ t _ cdecl _ beginthread (in _ _ beginthread _ proc _ type _ start address,_ tart address参数说明) 以下格式:
typedef void (_ cdecl * _ beginthread _ proc _ type ) ) void*;
实际上是voidthreadfun(void*param )的形式
_堆栈大小堆栈大小,与CreateThread相同,通常填写0
_ArgList参数列表,如果没有参数则为NULL
返回值必须成功返回到新线程的句柄,并使用reinterpret_castHANDLE强制转换