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

异步问题 #281

Open
zhonglaogen opened this issue Sep 8, 2023 · 3 comments
Open

异步问题 #281

zhonglaogen opened this issue Sep 8, 2023 · 3 comments

Comments

@zhonglaogen
Copy link

async_op_result.go
if aor.hasReturnedObj == 1 {
aor.doComplete()
}
改为
if atomic.LoadInt32(&aor.hasReturnedObj) == 1 {
aor.doComplete()
}
会不会更好

@hcraM41
Copy link
Collaborator

hcraM41 commented Sep 13, 2023

因为前面的判断逻辑做了CAS了,所以这里其实用不用atomic都是可以的,不过改成atomic让语法统一是个不错的建议,欢迎pr~

@hcraM41
Copy link
Collaborator

hcraM41 commented Sep 20, 2023

已调整~

@zhonglaogen
Copy link
Author

已调整~

感谢!!

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

2 participants