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
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/bthread/task_group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,9 +307,6 @@ void TaskGroup::task_runner(intptr_t skip_remained) {
thread_return = e.value();
}

// Group is probably changed
g = BAIDU_GET_VOLATILE_THREAD_LOCAL(tls_task_group);

// TODO: Save thread_return
(void)thread_return;

Expand All @@ -332,6 +329,9 @@ void TaskGroup::task_runner(intptr_t skip_remained) {
m->local_storage.keytable = NULL; // optional
}

// Group is probably changed
g = BAIDU_GET_VOLATILE_THREAD_LOCAL(tls_task_group);

// Increase the version and wake up all joiners, if resulting version
// is 0, change it to 1 to make bthread_t never be 0. Any access
// or join to the bthread after changing version will be rejected.
Expand Down
Loading