Skip to content

Commit 7dc7bf6

Browse files
committed
Relax threadfilter mem order
1 parent e932fc4 commit 7dc7bf6

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

ddprof-lib/src/main/cpp/threadFilter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ void ThreadFilter::add(int thread_id) {
135135
thread_id = mapThreadId(thread_id);
136136
assert(b == bitmap(thread_id));
137137
u64 bit = 1ULL << (thread_id & 0x3f);
138-
if (!(__sync_fetch_and_or(&word(b, thread_id), bit) & bit)) {
138+
if (!(__atomic_fetch_or(&word(b, thread_id), bit, __ATOMIC_RELAXED) & bit)) {
139139
atomicInc(_size);
140140
}
141141
}
@@ -148,7 +148,7 @@ void ThreadFilter::remove(int thread_id) {
148148
}
149149

150150
u64 bit = 1ULL << (thread_id & 0x3f);
151-
if (__sync_fetch_and_and(&word(b, thread_id), ~bit) & bit) {
151+
if (__atomic_fetch_and(&word(b, thread_id), ~bit, __ATOMIC_RELAXED) & bit) {
152152
atomicInc(_size, -1);
153153
}
154154
}

0 commit comments

Comments
 (0)