示例#1
0
void	ZKMORHP_ForeignThread::InitializeIfNecessary()
{
	if (mIsInitialized) return;
	mIsInitialized = true;
	mPThread = pthread_self();
	mPriority = GetScheduledPriority();
	
	mIsInNeedOfResynch = mThreadParameter->WorkLoopInit();
}
示例#2
0
void	CAPThread::DebugPriority(const char *label)
{
#if !TARGET_OS_WIN32
	if (mTimeConstraintSet)
		printf("CAPThread::%s %p: pri=<time constraint>, spawning pri=%d, scheduled pri=%d\n", label, this, 
		(int)mSpawningThreadPriority, (mPThread != NULL) ? (int)GetScheduledPriority() : -1);
	else
		printf("CAPThread::%s %p: pri=%d%s, spawning pri=%d, scheduled pri=%d\n", label, this, (int)mPriority, mFixedPriority ? " fixed" : "", 
		(int)mSpawningThreadPriority, (mPThread != NULL) ? (int)GetScheduledPriority() : -1);
#else
	if (mTimeConstraintSet)
	{
		printf("CAPThread::%s %p: pri=<time constraint>, spawning pri=%d, scheduled pri=%d\n", label, this, 
		(int)mPriority, (mThreadHandle != NULL) ? (int)GetScheduledPriority() : -1);
	}
	else
	{
		printf("CAPThread::%s %p: pri=%d%s, spawning pri=%d, scheduled pri=%d\n", label, this, (int)mPriority, mFixedPriority ? " fixed" : "", 
		(int)mPriority, (mThreadHandle != NULL) ? (int)GetScheduledPriority() : -1);
	}
#endif
}