コード例 #1
0
ファイル: synchcache.hpp プロジェクト: 0-wiz-0/coreclr
        void Add(CPalThread * pthrCurrent, T * pobj)
        {
            USynchCacheStackNode * pNode = reinterpret_cast<USynchCacheStackNode *>(pobj);

            if (NULL == pobj)
            {
                return;
            }

            pobj->~T();
            
            Lock(pthrCurrent);
            if (m_iDepth < m_iMaxDepth)
            {
#ifdef _DEBUG
                if (m_iDepth > m_iMaxTrackedDepth)
                {
                    m_iMaxTrackedDepth = m_iDepth;
                }
#endif
                pNode->next = m_pHead;
                m_pHead = pNode;
                m_iDepth++;
            }
            else
            {
                InternalDelete((char *)pNode);
            }
            Unlock(pthrCurrent);
        }
コード例 #2
0
void CBaseMenu::Destroy(bool releaseHandle)
{
	/* Check if we shouldn't be here */
	if (m_bDeleting)
	{
		return;
	}

#if defined MENU_DEBUG
	g_Logger.LogMessage("[SM_MENU] CBaseMenu::Destroy(%p) (release %d) (m_bCancelling %d) (m_bShouldDelete %d)",
		this,
		releaseHandle,
		m_bCancelling,
		m_bShouldDelete);
#endif

	/* Save the destruction hint about our handle */
	m_bWillFreeHandle = releaseHandle;

	/* Now actually do stuff */
	if (!m_bCancelling || m_bShouldDelete)
	{
		Cancel();
		InternalDelete();
	} else {
		m_bShouldDelete = true;
	}
}
コード例 #3
0
void CBaseBuiltinVote::Cancel()
{
	// Doesn't really do cancelling.  Use BuiltinVoteHandler's CancelVoting instead, which calls this internally
	/*

	if (m_bCancelling)
	{
		return;
	}

	m_bCancelling = true;

	if (!m_bResultDisplayed)
	{
		m_pHandler->OnVoteCancel(this, BuiltinVoteFail_Generic);
		m_pHandler->OnVoteEnd(this, BuiltinVoteEnd_Cancelled);
	}

	m_bCancelling = false;

	*/

	if (m_bShouldDelete)
	{
		InternalDelete();
	}
}
コード例 #4
0
UBOOL FFileManagerWindows::Delete( const TCHAR* Filename, UBOOL RequireExists, UBOOL EvenReadOnly )
{
#if USE_HASHES_SHA
	// Only allow writes to files that are not signed 
	// Except if the file is missing (that way corrupt ini files can be autogenerated by deleting them)
	BYTE TempHash[20];
	if( appGetFileSHAHash(Filename,TempHash) )
	{
		debugfSuppressed(NAME_DevSHA,TEXT("Can't delete signed game file: %s"),Filename);
		return FALSE;
	}
#endif
	
	// we can only delete from user directory
	return InternalDelete( *ConvertAbsolutePathToUserPath(*ConvertToAbsolutePath(Filename)), RequireExists, EvenReadOnly );
}
コード例 #5
0
void CBaseBuiltinVote::Destroy(bool releaseHandle)
{
	/* Check if we shouldn't be here */
	if (m_bDeleting)
	{
		return;
	}

	/* Save the destruction hint about our handle */
	m_bWillFreeHandle = releaseHandle;

	/* Now actually do stuff */
	if (!m_bCancelling || m_bShouldDelete)
	{
		Cancel();
		InternalDelete();
	} else {
		m_bShouldDelete = true;
	}
}
コード例 #6
0
void CBaseMenu::Cancel()
{
	if (m_bCancelling)
	{
		return;
	}

#if defined MENU_DEBUG
	g_Logger.LogMessage("[SM_MENU] CBaseMenu::Cancel(%p) (m_bShouldDelete %d)",
		this,
		m_bShouldDelete);
#endif

	m_bCancelling = true;
	Cancel_Finally();
	m_bCancelling = false;

	if (m_bShouldDelete)
	{
		InternalDelete();
	}
}
コード例 #7
0
ファイル: synchcache.hpp プロジェクト: 0-wiz-0/coreclr
        void Flush(CPalThread * pthrCurrent, bool fDontLock = false)
        {
            USynchCacheStackNode * pNode, * pTemp;

            if (!fDontLock)
            {
                Lock(pthrCurrent);
            }
            pNode = m_pHead;
            m_pHead = NULL;
            m_iDepth = 0;
            if (!fDontLock)
            {
                Unlock(pthrCurrent);
            }

            while (pNode)
            {
                pTemp = pNode;
                pNode = pNode->next;
                InternalDelete((char *)pTemp);
            }
        }