Skip to content

Commit

Permalink
Disambiguate the type of atomic_fetch_xxx
Browse files Browse the repository at this point in the history
  • Loading branch information
rpavlik committed Jan 24, 2022
1 parent fde8288 commit b9b94f8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/percetto.cc
Expand Up @@ -288,8 +288,9 @@ class PercettoDataSource
std::end(s_percetto.categories[i]->ext->strings),
std::begin(tags));
if (IsCategoryEnabled(s_percetto.categories[i]->ext->name, tags, config)) {
std::atomic_fetch_or(&s_percetto.categories[i]->sessions,
1ul << args.internal_instance_index);
std::atomic_fetch_or<std::uint_fast32_t>(
&s_percetto.categories[i]->sessions,
1ul << args.internal_instance_index);
}
}
UpdateGroupCategories();
Expand All @@ -300,7 +301,8 @@ class PercettoDataSource
void OnStop(const DataSourceBase::StopArgs& args) override {
int count = s_percetto.category_count.load(std::memory_order_acquire);
for (int i = 0; i < count; i++) {
std::atomic_fetch_and(&s_percetto.categories[i]->sessions,
std::atomic_fetch_and<std::uint_fast32_t>(
&s_percetto.categories[i]->sessions,
~(1ul << args.internal_instance_index));
}
UpdateGroupCategories();
Expand Down

0 comments on commit b9b94f8

Please sign in to comment.