if (!req)
return;
- if (virAtomicIntGet(&req->refctr) != 0)
+ if (g_atomic_int_get(&req->refctr) != 0)
return;
/* free all leases */
unsigned int diff;
/* submit packet to worker thread */
- if (virAtomicIntGet(&pcapConf[i].qCtr) >
+ if (g_atomic_int_get(&pcapConf[i].qCtr) >
pcapConf[i].maxQSize) {
if (last_displayed_queue - time(0) > 10) {
last_displayed_queue = time(0);
/* keep dead leases at < ~95% of file size */
if (virAtomicIntInc(&virNWFilterSnoopState.wLeases) >=
- virAtomicIntGet(&virNWFilterSnoopState.nLeases) * 20)
+ g_atomic_int_get(&virNWFilterSnoopState.nLeases) * 20)
virNWFilterSnoopLeaseFileLoad(); /* load & refresh lease file */
err_exit:
/*
* have the entry removed if it has no leases and no one holds a ref
*/
- del_req = ((req->start == NULL) && (virAtomicIntGet(&req->refctr) == 0));
+ del_req = ((req->start == NULL) && (g_atomic_int_get(&req->refctr) == 0));
virNWFilterSnoopReqUnlock(req);
static void
virNWFilterSnoopJoinThreads(void)
{
- while (virAtomicIntGet(&virNWFilterSnoopState.nThreads) != 0) {
+ while (g_atomic_int_get(&virNWFilterSnoopState.nThreads) != 0) {
VIR_WARN("Waiting for snooping threads to terminate: %u",
- virAtomicIntGet(&virNWFilterSnoopState.nThreads));
+ g_atomic_int_get(&virNWFilterSnoopState.nThreads));
g_usleep(1000 * 1000);
}
}
#include "internal.h"
-/**
- * virAtomicIntGet:
- * Gets the current value of atomic.
- *
- * This call acts as a full compiler and hardware memory barrier
- * (before the get)
- */
-#define virAtomicIntGet(v) g_atomic_int_get(v)
-
/**
* virAtomicIntSet:
* Sets the value of atomic to newval.
int ret;
int val;
- val = virAtomicIntGet(&virSystemdHasMachinedCachedValue);
+ val = g_atomic_int_get(&virSystemdHasMachinedCachedValue);
if (val != -1)
return val;
int ret;
int val;
- val = virAtomicIntGet(&virSystemdHasLogindCachedValue);
+ val = g_atomic_int_get(&virSystemdHasLogindCachedValue);
if (val != -1)
return val;
*/
VIR_DEBUG("Attempting to create machine via systemd");
- if (virAtomicIntGet(&hasCreateWithNetwork)) {
+ if (g_atomic_int_get(&hasCreateWithNetwork)) {
virError error;
memset(&error, 0, sizeof(error));