Migrating atomic ops to std::atomic where possible and poly.

This commit is contained in:
Ben Vanik
2014-07-12 17:48:54 -07:00
parent bf882714d0
commit 9b78dd977b
18 changed files with 174 additions and 139 deletions

View File

@@ -15,14 +15,14 @@ void xe_ref_init(xe_ref_t* ref) {
}
void xe_ref_retain(xe_ref_t* ref) {
xe_atomic_inc_32(&ref->count);
poly::atomic_inc(&ref->count);
}
void xe_ref_release(xe_ref_t* ref, xe_ref_dealloc_t dealloc) {
if (!ref) {
return;
}
if (!xe_atomic_dec_32(&ref->count)) {
if (!poly::atomic_dec(&ref->count)) {
if (dealloc) {
dealloc(ref);
}