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

ex_module_tryjoin可能会导致core dump #1

Open
panbiao opened this issue Aug 15, 2018 · 0 comments
Open

ex_module_tryjoin可能会导致core dump #1

panbiao opened this issue Aug 15, 2018 · 0 comments

Comments

@panbiao
Copy link

panbiao commented Aug 15, 2018

函数中有一处代码是这样写的:
ret=pthread_tryjoin_np(ex_module->proc_thread,&thread_return);
ex_module->retval=*thread_return;
*retval=*thread_return;
这里pthread_tryjoin_np是不阻塞的,所以返回时thread_return可能没有赋值,应该改成下面这种:
ret=pthread_tryjoin_np(ex_module->proc_thread,&thread_return);
if(ret == 0){
ex_module->retval=*thread_return;
*retval=*thread_return;
}

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