我在Windows上使用带有MinGW的Pthreads。对pthread_create的调用返回一个错误,该错误转换为“空间不足”。它指的是什么样的空间?线程堆栈空间?pthread_create没有足够的空间
int scannerThreadReturnValue = pthread_create(&parserThreadHandle, &attr, parserThread, (void *)filename);
if(scannerThreadReturnValue != 0) {
printf("Unable to create thread %s\n", strerror(errno));
}
else printf("Parser thread creation successfull\n");
检查'pthread_create()'参数的第四个参数段落到'parserThread()'必须作为指针传递给struct,你使用的是attr?否则将其设置为NULL –