void DMemModelProcess::AsyncCloseOsAsid() { if (__e32_atomic_tas_ord32(&iOsAsidRefCount, 1, -1, 0) == 1) {// Last reference has been closed so free the asid asynchronusly. MM::AsyncAddressSpaceFree(iOsAsid); } }
TInt DMemModelProcess::TryOpenOsAsid() { if (__e32_atomic_tas_ord32(&iOsAsidRefCount, 1, 1, 0)) { return iOsAsid; } return KErrDied; }
void DmacSim::StopEmulation() { TInt orig = __e32_atomic_tas_ord32(&StartStop, (TInt)EDmaSimStarted, (TInt)EDmaSimStopping, 0); if (orig == EDmaSimIdle) return; // wasn't running // loop until we succeed in cancelling the timer or the timer callback // notices that we are shutting down while (!Timer.Cancel() && __e32_atomic_load_acq32(&StartStop)!=EDmaSimIdle) {} __e32_atomic_store_ord32(&StartStop, EDmaSimIdle); }
TBool NFastMutexX::Close() { TInt r = __e32_atomic_tas_ord32(&iRefCount, 1, -1, 0); if (r==1) { memset(iMutex, 0xbf, sizeof(NFastMutex)); delete iMutex; iMutex = 0; } return r==1; }
EXPORT_C TInt User::SafeDec(TInt &aValue) /** Atomically decrements the specified value by 1, if the value is > 0. @param aValue The value to be decremented; on return the decremented value. @return The original value of aValue */ { return __e32_atomic_tas_ord32(&aValue, 1, -1, 0); }
TBool NFastMutexX::Open() { return __e32_atomic_tas_ord32(&iRefCount, 1, 1, 0) > 0; }