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

fix (ua2f.c): Incorrect cycle conditions #128

Closed
wants to merge 1 commit into from

Conversation

miny1233
Copy link
Contributor

  • 首先内循环中,handle_packet处理完毕后应该再立即检测是否是IO_READY,确保队列中每个包都被处理。由于每次should_exit设置后都有break,直接条件为1可以减少判断次数 (虽然性能上可能几乎没有提升)
  • 其次是外循环中,那个IO_READY中的 break会导致处理完一次队列后程序就自动退出

首先内循环中,handle_packet处理完毕后应该再立即检测是否时IO_READY,确保队列中每个包都被处理。由于每次should_exit设置后都有break,直接条件为1可以减少判断次数(虽然性能上可能几乎没有提升)。
其次是外循环中,那个break会导致处理完一次队列后程序就自动退出

Signed-off-by: miny1233 <[email protected]>
@miny1233 miny1233 closed this Jun 30, 2024
@miny1233
Copy link
Contributor Author

修错了,现在的问题还是内层循环出不来吧,switch中的break,不能让while跳出,只能跳出switch语句

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

Successfully merging this pull request may close these issues.

1 participant