8000 Make async registry data structure generic by jvolmer · Pull Request #21699 · arangodb/arangodb · GitHub
[go: up one dir, main page]

Skip to content

Make async registry data structure generic #21699

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

Merged
merged 12 commits into from
Apr 28, 2025
Prev Previous commit
Next Next commit
Resolve PR comments
  • Loading branch information
jvolmer committed Apr 22, 2025
commit 6985e030585adbe8037b3dd2854278447dbf2980
10 changes: 2 additions & 8 deletions lib/Async/Registry/promise.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,8 @@ Promise::Promise(Requester requester, std::source_location entry_point)
requester{requester} {}

auto arangodb::async_registry::get_current_coroutine() noexcept -> Requester* {
struct Guard {
// initialized with current thread
Guard() : _identifier{Requester::current_thread()} {}

Requester _identifier;
};
static thread_local auto guard = Guard{};
return &guard._identifier;
static thread_local auto identifier = Requester::current_thread();
return &identifier;
}

AddToAsyncRegistry::AddToAsyncRegistry(std::source_location loc)
Expand Down
2 changes: 1 addition & 1 deletion lib/Containers/Concurrent/ThreadOwnedList.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ concept CanBeSetToDeleted = requires(T t) {
thread (via garbage_collect()) or on another thread (via
garbage_collect_external()).

A thread owned list contains an atomic list of nodes. If a nodes is marked
A thread owned list contains an atomic list of nodes. If a node is marked
for deletion, it stays in this list, but is additionally added to the atomic
free list. The garbage collection goes through this free list, removes each
node in this free list from the node list (and from the free list as
Expand Down
0