priv->ignoreDeathEvent = false;
- if (virAtomicIntDecAndTest(&driver->nactive) && driver->inhibitCallback)
+ if (!!g_atomic_int_dec_and_test(&driver->nactive) && driver->inhibitCallback)
driver->inhibitCallback(false, driver->inhibitOpaque);
if ((vm->def->ngraphics == 1) &&
vm->pid = -1;
vm->def->id = -1;
- if (virAtomicIntDecAndTest(&driver->nactive) && driver->inhibitCallback)
+ if (!!g_atomic_int_dec_and_test(&driver->nactive) && driver->inhibitCallback)
driver->inhibitCallback(false, driver->inhibitOpaque);
virLXCDomainReAttachHostDevices(driver, vm->def);
virNWFilterSnoopLock();
- if (virAtomicIntDecAndTest(&req->refctr)) {
+ if (!!g_atomic_int_dec_and_test(&req->refctr)) {
/*
* delete the request:
* - if we don't find req on the global list anymore
skip_instantiate:
VIR_FREE(ipl);
- ignore_value(virAtomicIntDecAndTest(&virNWFilterSnoopState.nLeases));
+ ignore_value(!!g_atomic_int_dec_and_test(&virNWFilterSnoopState.nLeases));
lease_not_found:
VIR_FREE(ipstr);
_("Instantiation of rules failed on "
"interface '%s'"), req->binding->portdevname);
}
- ignore_value(virAtomicIntDecAndTest(job->qCtr));
+ ignore_value(!!g_atomic_int_dec_and_test(job->qCtr));
VIR_FREE(job);
}
pcap_close(pcapConf[i].handle);
}
- ignore_value(virAtomicIntDecAndTest(&virNWFilterSnoopState.nThreads));
+ ignore_value(!!g_atomic_int_dec_and_test(&virNWFilterSnoopState.nThreads));
return;
}
qemuProcessBuildDestroyMemoryPaths(driver, vm, NULL, false);
- if (virAtomicIntDecAndTest(&driver->nactive) && driver->inhibitCallback)
+ if (!!g_atomic_int_dec_and_test(&driver->nactive) && driver->inhibitCallback)
driver->inhibitCallback(false, driver->inhibitOpaque);
/* Wake up anything waiting on domain condition */
#include "internal.h"
-/**
- * virAtomicIntDecAndTest:
- * Decrements the value of atomic by 1.
- *
- * Think of this operation as an atomic version of
- * { *atomic -= 1; return *atomic == 0; }
- *
- * This call acts as a full compiler and hardware memory barrier.
- */
-#define virAtomicIntDecAndTest(i) (!!g_atomic_int_dec_and_test(i))
-
/**
* virAtomicIntCompareExchange:
* Compares atomic to oldval and, if equal, sets it to newval. If
if (VIR_OBJECT_NOTVALID(obj))
return false;
- bool lastRef = virAtomicIntDecAndTest(&obj->u.s.refs);
+ bool lastRef = !!g_atomic_int_dec_and_test(&obj->u.s.refs);
PROBE(OBJECT_UNREF, "obj=%p", obj);
if (lastRef) {
PROBE(OBJECT_DISPOSE, "obj=%p", obj);