コード例 #1
0
ファイル: InitializeDll.cpp プロジェクト: casseveritt/glslang
bool InitProcess()
{
    glslang::GetGlobalLock();

    if (ThreadInitializeIndex != OS_INVALID_TLS_INDEX) {
		//
		// Function is re-entrant.
		//

        glslang::ReleaseGlobalLock();
        return true;
	}

    ThreadInitializeIndex = OS_AllocTLSIndex();

    if (ThreadInitializeIndex == OS_INVALID_TLS_INDEX) {
        assert(0 && "InitProcess(): Failed to allocate TLS area for init flag");

        glslang::ReleaseGlobalLock();
        return false;
	}

    if (! InitializePoolIndex()) {
        assert(0 && "InitProcess(): Failed to initalize global pool");

        glslang::ReleaseGlobalLock();
        return false;
	}

	InitThread();

    glslang::ReleaseGlobalLock();
    return true;
}
コード例 #2
0
ファイル: HLSL2GLSL.cpp プロジェクト: Irina4ik/hlsl2glslfork
static bool InitProcess()
{
	if (s_ThreadInitialized != OS_INVALID_TLS_INDEX)
		return true;
	
	s_ThreadInitialized = OS_AllocTLSIndex();
	if (s_ThreadInitialized == OS_INVALID_TLS_INDEX)
	{
		assert(0 && "InitProcess(): Failed to allocate TLS area for init flag");
		return false;
	}
	
	if (!InitializePoolIndex())
	{
		assert(0 && "InitProcess(): Failed to initalize global pool");
		return false;
	}
	
	if (!InitializeParseContextIndex())
	{
		assert(0 && "InitProcess(): Failed to initalize parse context");
		return false;
	}
	
	InitThread();
	return true;
}
コード例 #3
0
bool InitProcess()
{
    if (ThreadInitializeIndex != OS_INVALID_TLS_INDEX) {
		//
		// Function is re-entrant.
		//
        return true;
	}

    ThreadInitializeIndex = OS_AllocTLSIndex();

    if (ThreadInitializeIndex == OS_INVALID_TLS_INDEX) {
        assert(0 && "InitProcess(): Failed to allocate TLS area for init flag");
        return false;
	}


    if (!InitializePoolIndex()) {
        assert(0 && "InitProcess(): Failed to initalize global pool");
        return false;
	}

    if (!InitializeParseContextIndex()) {
        assert(0 && "InitProcess(): Failed to initalize parse context");
        return false;
	}

	InitThread();
    return true;
}
コード例 #4
0
ファイル: PoolAlloc.cpp プロジェクト: lofter2011/Icefox
bool InitializePoolIndex()
{
    // Allocate a TLS index.
    if ((PoolIndex = OS_AllocTLSIndex()) == OS_INVALID_TLS_INDEX)
        return false;

    return true;
}
コード例 #5
0
bool InitializeParseContextIndex()
{
    if (GlobalParseContextIndex != OS_INVALID_TLS_INDEX) {
        assert(0 && "InitializeParseContextIndex(): Parse Context already initalised");
        return false;
    }

    //
    // Allocate a TLS index.
    //
    GlobalParseContextIndex = OS_AllocTLSIndex();
    
    if (GlobalParseContextIndex == OS_INVALID_TLS_INDEX) {
        assert(0 && "InitializeParseContextIndex(): Parse Context already initalised");
        return false;
    }

    return true;
}