Skip to content
New issue

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

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

Already on GitHub? # to your account

Fix using butex in return keytable #2558

Merged
merged 2 commits into from
Mar 11, 2024
Merged

Fix using butex in return keytable #2558

merged 2 commits into from
Mar 11, 2024

Conversation

MJY-HUST
Copy link
Contributor

@MJY-HUST MJY-HUST commented Mar 4, 2024

What problem does this PR solve?

Issue Number:
#2554
Problem Summary:
当一个bthread(taskmeta中的attr.keytable_pool = null)的生命周期结束,且其拥有keytable实例时。在销毁keytable时会调用由用户创建bthread_key_create(bthread_key_t* key, void (destructor)(void data))中传入的destructor析构函数,如果destructor内部使用了bthread-mutex并挂起的话,bthread恢复后所在的task_group会发生变化。在现有的task_runner实现中,如果在return_keytable后不重新指定task_group的话,调用ending_sched(&g)会出现错误。

What is changed and the side effects?

Changed:

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.(请遵循贡献者准则).

Copy link
Contributor

@chenBright chenBright left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@chenBright chenBright left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MJY-HUST 可以加上注释和UT吗?

@MJY-HUST
Copy link
Contributor Author

MJY-HUST commented Mar 8, 2024

@chenBright 加上了UT和注释

Copy link
Contributor

@chenBright chenBright left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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

Successfully merging this pull request may close these issues.

在bthread_key_create方法入参的析构函数destructor内部使用bthread-mutex存在的问题
3 participants