这篇教程C++ GetThreadPriority函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetThreadPriority函数的典型用法代码示例。如果您正苦于以下问题:C++ GetThreadPriority函数的具体用法?C++ GetThreadPriority怎么用?C++ GetThreadPriority使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetThreadPriority函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: JReferenceJThread::JThread(int handle) : JReference(handle) { priority = fromPlatform( GetThreadPriority((HANDLE)handle)); ptarget = null;}
开发者ID:neattools,项目名称:neattools,代码行数:11,
示例2: GetThreadPriorityint CThread::GetPriority() const{#ifdef _WIN32 return GetThreadPriority(m_hThread);#elif _LINUX struct sched_param thread_param; int policy; pthread_getschedparam( m_threadId, &policy, &thread_param ); return thread_param.sched_priority;#endif}
开发者ID:FWGS,项目名称:libvinterface,代码行数:11,
示例3: main_setRenderThreadPriorityvoid main_setRenderThreadPriority(){ int prios[]={ GetThreadPriority(GetCurrentThread()), THREAD_PRIORITY_IDLE, THREAD_PRIORITY_LOWEST, THREAD_PRIORITY_NORMAL, THREAD_PRIORITY_HIGHEST, }; SetThreadPriority(g_hThread,prios[cfg_render_prio]);}
开发者ID:majek,项目名称:avs,代码行数:11,
示例4: MPOS_Startstatic void MPOS_Start(void) { #if defined(RB_MSVC_WIN32) hApp = GetCurrentProcess(); hThread = GetCurrentThread(); iPriorityClass = GetPriorityClass(hApp); iPriority = GetThreadPriority(hThread); if (iPriorityClass != 0) SetPriorityClass(hApp, REALTIME_PRIORITY_CLASS); if (iPriority != THREAD_PRIORITY_ERROR_RETURN) SetThreadPriority(hThread, THREAD_PRIORITY_TIME_CRITICAL); #elif defined(RB_MSVC_WINCE) hThread = GetCurrentThread(); iPriority = GetThreadPriority(hThread); if (iPriority != THREAD_PRIORITY_ERROR_RETURN) SetThreadPriority(hThread, THREAD_PRIORITY_TIME_CRITICAL); #elif defined(RB_LINUX) iPriority = getpriority(PRIO_PROCESS, 0); //lazy to check error:p setpriority(PRIO_PROCESS, 0, -20); #else //backup & disable all IRQ except COM port's IRQ #endif}
开发者ID:mhk2010,项目名称:roboard-hexapod,代码行数:21,
示例5: sys_arch_timeouts/*----------------------------------------------------------------------*/struct sys_timeouts * sys_arch_timeouts(void){ u8_t prio = GetThreadPriority(GetCurrentThread()); u8_t offset = prio - LWIP_START_PRIO; if (prio == THREAD_PRIORITY_ERROR_RETURN) { fprintf(stderr, "CreateThread failed with %d./n", GetLastError()); return &lwip_timeouts[LWIP_TASK_MAX]; } if (offset >= 0 && offset < LWIP_TASK_MAX) return &lwip_timeouts[offset]; return &lwip_timeouts[LWIP_TASK_MAX];}
开发者ID:MetaEngine,项目名称:lwip-win32,代码行数:14,
示例6: GetThreadPriorityUInt32 CAPThread::GetScheduledPriority(){#if TARGET_OS_MAC return CAPThread::getScheduledPriority( mPThread, CAPTHREAD_SCHEDULED_PRIORITY );#elif TARGET_OS_WIN32 UInt32 theAnswer = 0; if(mThreadHandle != NULL) { theAnswer = GetThreadPriority(mThreadHandle); } return theAnswer;#endif}
开发者ID:cchaz003,项目名称:rivenx,代码行数:13,
示例7: GetThreadPriority/** 等待给出的线程结束.*/void mvg::synch::joinThread(const TThreadHandle &threadHandle){ if (threadHandle.isClear()) return; int prio = GetThreadPriority((HANDLE)threadHandle.hThread); if (THREAD_PRIORITY_ERROR_RETURN == prio) return; // 这边表示这个不是一个正在运行的线程 DWORD ret = WaitForSingleObject((HANDLE)threadHandle.hThread, INFINITE); if (ret != WAIT_OBJECT_0) std::cerr << "[mvg::synch::joinThread] Error waiting for thread completion!" << std::endl;}
开发者ID:yueying,项目名称:3DReconstruction,代码行数:15,
示例8: pthread_selfpthread_tpthread_self (void){ pthread_t self; pthread_t nil = {NULL, 0}; ptw32_thread_t * sp;#if defined(_UWIN) if (!ptw32_selfThreadKey) return nil;#endif sp = (ptw32_thread_t *) pthread_getspecific (ptw32_selfThreadKey); if (sp != NULL) { self = sp->ptHandle; } else { self = ptw32_new (); sp = (ptw32_thread_t *) self.p; if (sp != NULL) { sp->implicit = 1; sp->detachState = PTHREAD_CREATE_DETACHED; sp->thread = GetCurrentThreadId ();#if defined(NEED_DUPLICATEHANDLE) sp->threadH = GetCurrentThread ();#else if (!DuplicateHandle (GetCurrentProcess (), GetCurrentThread (), GetCurrentProcess (), &sp->threadH, 0, FALSE, DUPLICATE_SAME_ACCESS)) { ptw32_threadReusePush (self); return nil; }#endif sp->sched_priority = GetThreadPriority (sp->threadH); pthread_setspecific (ptw32_selfThreadKey, (void *) sp); } } return (self);}
开发者ID:qtekfun,项目名称:htcDesire820Kernel,代码行数:51,
示例9: SDL_WM_SetCaptionvoid CUI_LoadMsg::enter(void) { need_refresh = 1; load_finished = 0;// setWindowTitle("zt - loading file..."); SDL_WM_SetCaption("zt - [loading file]","zt - [loading file]"); OldPriority = GetThreadPriority(GetCurrentThread()); strtimer = strselect = 0; strtimer = SetTimer(NULL,strtimer,500,(TIMERPROC)TP_Load_Inc_Str); SetThreadPriority(GetCurrentThread(),THREAD_PRIORITY_BELOW_NORMAL); hThread = CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)load_thread,NULL,0,&iID); while(load_lock) { SDL_Delay(1); }}
开发者ID:cmicali,项目名称:ztracker,代码行数:14,
示例10: lockbool CThread::WaitForThreadExit(unsigned int milliseconds){ bool bReturn = true; CSingleLock lock(m_CriticalSection); if (m_ThreadId && m_ThreadOpaque.handle != NULL) { // boost priority of thread we are waiting on to same as caller int callee = GetThreadPriority(m_ThreadOpaque.handle); int caller = GetThreadPriority(::GetCurrentThread()); if(caller != THREAD_PRIORITY_ERROR_RETURN && caller > callee) SetThreadPriority(m_ThreadOpaque.handle, caller); lock.Leave(); bReturn = m_TermEvent.WaitMSec(milliseconds); lock.Enter(); // restore thread priority if thread hasn't exited if(callee != THREAD_PRIORITY_ERROR_RETURN && caller > callee && m_ThreadOpaque.handle) SetThreadPriority(m_ThreadOpaque.handle, callee); } return bReturn;}
开发者ID:AchimTuran,项目名称:xbmc,代码行数:23,
示例11: EvalPriorityExpandvoid EvalPriorityExpand(const void *data, qCtx *ctx, qStr *out, qArgAry *args) { if (ctx->GetSafeMode()) {ctx->Throw(out, 301, "function not available"); return;} int priority = THREAD_PRIORITY_ERROR_RETURN; CStr pname = (*args)[0]; if (!stricmp(pname,"low")) { priority = THREAD_PRIORITY_BELOW_NORMAL; } if (!stricmp(pname,"high")) { priority = THREAD_PRIORITY_ABOVE_NORMAL; } if (!stricmp(pname,"normal")) { priority = THREAD_PRIORITY_NORMAL; } if (!stricmp(pname,"lowest")) { priority = THREAD_PRIORITY_LOWEST; } if (!stricmp(pname,"highest")) { priority = THREAD_PRIORITY_HIGHEST; } if (priority == THREAD_PRIORITY_ERROR_RETURN) ctx->Throw(out, 353, "Priority must be one of low, high, normal, lowest, highest"); else { DWORD was = GetThreadPriority(GetCurrentThread()); SetThreadPriority(GetCurrentThread(), priority); try { ctx->Parse(args->GetAt(1),out); } catch (qCtxExAbort ex) { SetThreadPriority(GetCurrentThread(), was); throw ex; } catch (qCtxEx ex) { SetThreadPriority(GetCurrentThread(), was); throw ex; } catch (...) { qCtxEx ex(354, "Unknown exception during priority shift"); SetThreadPriority(GetCurrentThread(), was); throw ex; } SetThreadPriority(GetCurrentThread(), was); }}
开发者ID:BackupTheBerlios,项目名称:smx-svn,代码行数:50,
|