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

Function acl_atomic_set

lib_acl/src/stdlib/acl_atomic.c:94–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92}
93
94void acl_atomic_set(ACL_ATOMIC *self, void *value)
95{
96#ifndef HAS_ATOMIC
97 acl_pthread_mutex_lock(&self->lock);
98 self->value = value;
99 acl_pthread_mutex_unlock(&self->lock);
100#elif defined(ACL_WINDOWS)
101 InterlockedExchangePointer((volatile PVOID*) &self->value, value);
102#else
103 (void) __sync_lock_test_and_set(&self->value, value);
104#endif
105}
106
107void *acl_atomic_cas(ACL_ATOMIC *self, void *cmp, void *value)
108{

Callers 15

testFunction · 0.85
test2Function · 0.85
acl_fiber_event_createFunction · 0.85
fbase_initFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
acl_atomic_clock_allocFunction · 0.85
acl_ypipe_newFunction · 0.85
acl_ypipe_flushFunction · 0.85
acl_yqueue_newFunction · 0.85
servers_startFunction · 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…