MCPcopy Create free account
hub / github.com/acl-dev/acl / acl_atomic_int64_fetch_add

Function acl_atomic_int64_fetch_add

lib_acl/src/stdlib/acl_atomic.c:158–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

156}
157
158long long acl_atomic_int64_fetch_add(ACL_ATOMIC *self, long long n)
159{
160#ifndef HAS_ATOMIC
161 acl_pthread_mutex_lock(&self->lock);
162 long long v = *(long long *) self->value;
163 *((long long *) self->value) = v + n;
164 acl_pthread_mutex_unlock(&self->lock);
165 return v;
166#elif defined(ACL_WINDOWS)
167 return InterlockedExchangeAdd64((volatile LONGLONG*) self->value, n);
168#else
169 return (long long) __sync_fetch_and_add((long long *) self->value, n);
170#endif
171}
172
173long long acl_atomic_int64_add_fetch(ACL_ATOMIC *self, long long n)
174{

Callers 5

testFunction · 0.85
test2Function · 0.85
udp_server_exitFunction · 0.85
fetch_addMethod · 0.85
icmp_chat_createFunction · 0.85

Calls 2

acl_pthread_mutex_lockFunction · 0.85
acl_pthread_mutex_unlockFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…