Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

windows-vs2015测试co_pool例子会崩溃 #283

Open
zsxcandy opened this issue Nov 1, 2022 · 0 comments
Open

windows-vs2015测试co_pool例子会崩溃 #283

zsxcandy opened this issue Nov 1, 2022 · 0 comments

Comments

@zsxcandy
Copy link

zsxcandy commented Nov 1, 2022

void done()
{
printf("done.\n");
}

int calc() {
return 1024;
}

void callback(int val) {
printf("calc result: %d\n", val);
}

void main()
{
co::AsyncCoroutinePool * pPool = co::AsyncCoroutinePool::Create(1024);

pPool->InitCoroutinePool(1024);

pPool->Start(4, 128);



auto cbp = new co::AsyncCoroutinePool::CallbackPoint;
pPool->AddCallbackPoint(cbp); 


pPool->Post(&foo, &done);

pPool->Post<int>(&calc, &callback);


for (;;) {
    size_t trigger = cbp->Run();
    if (trigger > 0)
        break;
}

}

就在这个循环里面,感觉好像是死循环了,一直出不来,后面就崩溃了.
是不是没有消息,post之后,在Run里面Pop出来都是空的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant