Ejemplo n.º 1
0
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);
		}
	}
Ejemplo n.º 2
0
TInt DMemModelProcess::TryOpenOsAsid()
	{
	if (__e32_atomic_tas_ord32(&iOsAsidRefCount, 1, 1, 0))
		{
		return iOsAsid;
		}
	return KErrDied;
	}
Ejemplo n.º 3
0
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);
	}
Ejemplo n.º 4
0
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;
	}
Ejemplo n.º 5
0
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);
	}
Ejemplo n.º 6
0
TBool NFastMutexX::Open()
	{
	return __e32_atomic_tas_ord32(&iRefCount, 1, 1, 0) >  0;
	}