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

Support a more safe read function and variadic functions of DoublyBufferedData #2898

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

chenBright
Copy link
Contributor

@chenBright chenBright commented Feb 23, 2025

What problem does this PR solve?

Issue Number:

Problem Summary:

DoublyBufferedData::Read要配合ScopedPtr使用,使用上需要理解成本,甚至有可能会用错,导致死锁等问题。

What is changed and the side effects?

Changed:

  1. 增加一个DoublyBufferedData::Read重载函数,用户只需要传入自定义函数,操作T就可以了。
  2. 支持可变参数。

Side effects:

  • Performance effects(性能影响):

  • Breaking backward compatibility(向后兼容性):


Check List:

  • Please make sure your changes are compilable(请确保你的更改可以通过编译).
  • When providing us with a new feature, it is best to add related tests(如果你向我们增加一个新的功能, 请添加相关测试).
  • Please follow Contributor Covenant Code of Conduct.(请遵循贡献者准则).

@wwbmmm
Copy link
Contributor

wwbmmm commented Feb 23, 2025

LGTM

@chenBright chenBright changed the title Add a convenient and safe DoublyBufferedData::Read Support a more safe read function and variadic functions of DoublyBufferedData Feb 24, 2025
@chenBright
Copy link
Contributor Author

chenBright commented Feb 24, 2025

  1. 入参Fn使用Universal Reference,扩展Fn的形式,可接收右值实参。
  2. 支持可变参数。
  3. 补充UT。

@yanglimingcn
Copy link
Contributor

LGTM

1 similar comment
@wwbmmm
Copy link
Contributor

wwbmmm commented Feb 25, 2025

LGTM

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.

3 participants