本文整理汇总了C++中Thread::Release方法的典型用法代码示例。如果您正苦于以下问题:C++ Thread::Release方法的具体用法?C++ Thread::Release怎么用?C++ Thread::Release使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Thread
的用法示例。
在下文中一共展示了Thread::Release方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PthreadMain
void * PthreadMain (void * param)
{
Logger::Info("[Thread::ThreadFunction] param = %p", param);
Thread * t = (Thread*)param;
ThreadContext *context = NULL;
CorePlatformAndroid *core = (CorePlatformAndroid *)Core::Instance();
if(t->needCopyContext)
{
context = core->CreateThreadContext();
core->BindThreadContext(context);
}
t->state = Thread::STATE_RUNNING;
t->msg(t);
if(t->needCopyContext)
{
core->UnbindThreadContext(context);
core->ReleaseThreadContext(context);
context = NULL;
}
t->state = Thread::STATE_ENDED;
t->Release();
pthread_exit(0);
}
示例2: PthreadMain
void * PthreadMain (void * param)
{
Logger::Info("[PthreadMain] param = %p", param);
Thread * t = (Thread*)param;
if(t->needCopyContext)
{
EGLConfig localConfig;
bool ret = GetConfig(Thread::currentDisplay, localConfig);
Logger::Info("[PthreadMain] GetConfig returned = %d", ret);
if(ret)
{
EGLint contextAttrs[] = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE };
t->localContext = eglCreateContext(t->currentDisplay, localConfig, t->currentContext, contextAttrs);
// t->localContext = eglCreateContext(t->currentDisplay, localConfig, EGL_NO_CONTEXT, contextAttrs);
}
if(t->localContext == EGL_NO_CONTEXT)
{
Logger::Error("[PthreadMain] Can't create local context");
}
GLint surfAttribs[] =
{
EGL_HEIGHT, 768,
EGL_WIDTH, 1024,
EGL_NONE
};
EGLSurface readSurface = eglCreatePbufferSurface(t->currentDisplay, localConfig, surfAttribs);
// EGLSurface drawSurface = eglCreatePbufferSurface(t->currentDisplay, localConfig, surfAttribs);
//TODO: set context
// bool ret2 = eglMakeCurrent(t->currentDisplay, t->currentDrawSurface, t->currentReadSurface, t->localContext);
bool ret2 = eglMakeCurrent(t->currentDisplay, readSurface, readSurface, t->localContext);
Logger::Info("[PthreadMain] set eglMakeCurrent returned = %d", ret2);
}
t->state = Thread::STATE_RUNNING;
t->msg(t);
if(t->needCopyContext)
{
//TODO: Restore context
bool ret = eglMakeCurrent(t->currentDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
Logger::Info("[PthreadMain] restore eglMakeCurrent returned = %d", ret);
}
t->state = Thread::STATE_ENDED;
t->Release();
pthread_exit(0);
}
示例3: PthreadMain
void * PthreadMain (void * param)
{
Thread * t = (Thread*)param;
t->SetThreadId(Thread::GetCurrentThreadId());
t->state = Thread::STATE_RUNNING;
t->msg(t);
t->state = Thread::STATE_ENDED;
t->Release();
pthread_exit(0);
}
示例4: ThreadFunc
DWORD WINAPI ThreadFunc(void* param)
{
Thread * t = (Thread*)param;
t->SetThreadId(Thread::GetCurrentThreadId());
t->state = Thread::STATE_RUNNING;
t->msg(t);
t->state = Thread::STATE_ENDED;
t->Release();
return 0;
}
示例5: ThreadFunc
DWORD WINAPI ThreadFunc(void* param)
{
Thread * t = (Thread*)param;
if(t->needCopyContext)
{
#if defined(__DAVAENGINE_OPENGL__)
int32 res = wglMakeCurrent(Thread::currentDC, Thread::secondaryContext);
if(!res)
{
DWORD error = GetLastError();
Logger::Error("ThreadFunc::wglMakeCurrent error %d", error);
}
#elif defined(__DAVAENGINE_DIRECTX9__)
#endif // #if defined(__DAVAENGINE_OPENGL__)
}
t->state = Thread::STATE_RUNNING;
t->msg(t);
if(t->needCopyContext)
{
#if defined(__DAVAENGINE_OPENGL__)
int32 res = wglMakeCurrent(Thread::currentDC, NULL);
if(!res)
{
DWORD error = GetLastError();
Logger::Error("ThreadFunc::wglMakeCurrent NULL, error %d", error);
}
#elif defined(__DAVAENGINE_DIRECTX9__)
#endif // #if defined(__DAVAENGINE_OPENGL__)
}
t->state = Thread::STATE_ENDED;
t->Release();
return 0;
}
示例6: AsynchDownload
void FileDownloader::AsynchDownload()
{
Thread * downloadThread = Thread::Create( Message( this, &FileDownloader::DownloadFile ) );
downloadThread->Start();
downloadThread->Release();
}