]>
git.saurik.com Git - apple/icu.git/blob - icuSources/common/sharedobject.cpp
2 ******************************************************************************
3 * Copyright (C) 2014, International Business Machines
4 * Corporation and others. All Rights Reserved.
5 ******************************************************************************
8 #include "sharedobject.h"
11 SharedObject::~SharedObject() {}
14 SharedObject::addRef() const {
15 umtx_atomic_inc(&refCount
);
19 SharedObject::removeRef() const {
20 if(umtx_atomic_dec(&refCount
) == 0) {
26 SharedObject::getRefCount() const {
27 return umtx_loadAcquire(refCount
);
31 SharedObject::deleteIfZeroRefCount() const {
32 if(getRefCount() == 0) {