我有这样的事情:
...
int fcgiInit = FCGX_Init();
if(fcgiInit != 0)
{
return 1;
}
int socket = FCGX_OpenSocket(":8000", 100);
if(socket == -1)
{
return 2;
}
//point A
FCGX_Request* request = new FCGX_Request;
if(FCGX_InitRequest(request, socket, FCGI_FAIL_ACCEPT_ON_INTR) != 0)
{
return 3;
}
...
//point B
它运行良好,但当我尝试在另一个线程中使用A和B点之间的代码运行它时,我的程序在FCGX_InitRequest()
调用后以状态-1终止。
什么是错的,我可以正确地做到吗?
PS。我希望今年能得到答案;)
答案 0 :(得分:0)
FCGX_Init()
。这意味着:
...
int socket = FCGX_OpenSocket(":8000", 100);
...
//point A
int fcgiInit = FCGX_Init();
...
if(FCGX_InitRequest(request, socket, FCGI_FAIL_ACCEPT_ON_INTR) != 0)
...
//point B