当前位置: 首页>>代码示例>>C++>>正文


C++ RThread函数代码示例

本文整理汇总了C++中RThread函数的典型用法代码示例。如果您正苦于以下问题:C++ RThread函数的具体用法?C++ RThread怎么用?C++ RThread使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了RThread函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ChildMain

//
// Remote (i.e. running in its own process) child's entry point.
// Note that the child's process entry point is still E32Main() process (see below)
//
TInt ChildMain(TBMSpawnArgs* args)
	{
	args->iChildOrigPriority = BMProgram::SetAbsPriority(RThread(), args->iChildPrio);
		// get a handle to the parent's thread in the child's context.
	TInt r = args->iParent.Open(args->iParentId);
	BM_ERROR(r, r == KErrNone);
	return args->iChildFunc(args);
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:12,代码来源:bm_main.cpp

示例2: OpenChannelL

// -----------------------------------------------------------------------------
// CSensrvTest::OpenChannelL
// Parameters: ChannelId(TUint32), ContextType(TInt), Quantity(TInt), 
//              ChannelType(TUint32), dataSize(TInt), Location(TDesC8), VendorId(TDesC8)(optional)
// 
// -----------------------------------------------------------------------------
//
TInt CSensrvTest::OpenChannelL( CStifItemParser& aItem )
    {
    RDebug::Print(RThread().Name());
    RDebug::Print( _L("CSensrvTest::OpenChannelL") );
    RDebug::Print( _L("CSensrvTest::OpenChannelL: Get parapeters") );
    
    TSensrvChannelInfo channelInfo;
    
    TInt err = ParseChannelInfo( channelInfo, aItem );
    
    if( err )
        {
        RDebug::Print( _L("CSensrvTest::OpenChannelL: parameter error: %d"), err );
        return err;
        }
    
    iChannelInfoList.Reset();
        
    err = FindChannels( iChannelInfoList, channelInfo );
    if( err )
        {
        RDebug::Print( _L("CSensrvTest::OpenChannelL: FindChanels error: %d"), err );
        return err;
        }
    if( iChannelInfoList.Count == 0 )
        {
        RDebug::Print( _L("CSensrvTest::FindChannelsL: Channel not found" ) );
        return KErrNotFound;
        }
    if( !iSensorChannel )
        {
        RDebug::Print( _L("CSensrvTest::OpenChannelL - Create iSensorChannel...") );
        RDebug::Print( _L("CSensrvTest::OpenChannelL - ChannelId = %d "), iChannelInfoList[ 0 ].iChannelId );
        iSensorChannel = CSensrvSensorChannel::NewL( iChannelInfoList[ 0 ] );
        RDebug::Print( _L("CSensrvTest::OpenChannelL - iSensorChannel Created") );
        }
        
    RDebug::Print( _L("CSensrvTest::OpenChannelL - Open channel %d"), iChannelInfoList[ 0 ].iChannelId );
    TRAP( err, iSensorChannel->OpenChannelL() );
    TInt openedChannel( 0 );
    RProperty::Get( KPSUidSensrvTest, KSensrvLatestOpenedChannel, openedChannel );
    if( err )
        {
        RDebug::Print( _L("CSensrvTest::OpenChannelL - Open channel error %d"), err );
        }
    else if( openedChannel != iChannelInfoList[ 0 ].iChannelId )
        {
        RDebug::Print( _L("CSensrvTest::OpenChannelL - Incorrect channel opened."), err );
        RDebug::Print( _L("CSensrvTest::OpenChannelL - opened hannel: %d"), openedChannel );
        err = KErrGeneral;
        }
    else
        {
        RDebug::Print( _L("CSensrvTest::OpenChannelL - Channel open") );
        }
   
    return err;
    }
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:65,代码来源:SensrvTestChannel.cpp

示例3: silc_thread_self

SilcThread silc_thread_self(void)
{
#ifdef SILC_THREADS
  RThread thread = RThread();
  return (SilcThread)&thread;
#else
  return NULL;
#endif
}
开发者ID:FabrizioFabbe,项目名称:runtime,代码行数:9,代码来源:silcsymbianthread.cpp

示例4: CActive

CFlushActive::CFlushActive(CMD5Active& aBufferHandler):
CActive(CActive::EPriorityHigh),    // Higher priority than CMD5Active to ensure we run before them when the Active Scheduler is picking who to run next
iBufferHandler(aBufferHandler)
    {
    CActiveScheduler::Add(this);
    iRunLContext = RThread();
    iStatus = KRequestPending;
    SetActive();
    }
开发者ID:cdaffara,项目名称:symbian-oss_adapt,代码行数:9,代码来源:omxiltestmd5sinkprocessingfunction.cpp

示例5: RProcess

CTestBase::~CTestBase()
	{
	//
	// Restore the process and thread priority...
	//
	RProcess().SetPriority(iOrgProcessPriority);
	RThread().SetPriority(iOrgThreadPriority);
	
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:9,代码来源:Te_LoopbackTestStepBase.cpp

示例6: INFO_PRINTF1

TVerdict CSimNoConfigFileTest::doTestStepL()
	{
	INFO_PRINTF1(_L("Testing Phone open without Config File present"));
	DeleteConfigFileL();
	TESTL(iPhone.Open(iTelServer,KPhoneName)==KErrNotFound);
	iPhone.Close();
	ASSERT(RThread().RequestCount()==0);
	return TestStepResult();
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:9,代码来源:Te_SimNoConfigFileTest.cpp

示例7: GetEka1ExeEntryPoint

extern "C" TLinAddr GetEka1ExeEntryPoint()
	{
	TLinAddr a = 0;
	RLibrary l;
	TInt r = l.Load(KEka1EntryStubName, KNullDesC, TUidType(KDynamicLibraryUid, KEka1EntryStubUid));
	if (r == KErrNone)
		r = l.Duplicate(RThread(), EOwnerProcess);
	if (r == KErrNone)
		{
		a = (TLinAddr)l.Lookup(1);
		if (!a)
			r = KErrNotSupported;
		}
	if (r != KErrNone)
		RThread().Kill(r);
	Exec::SetReentryPoint(a);
	return a;
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:18,代码来源:up_utl.cpp

示例8: E32Main

GLDEF_C TInt E32Main()
    {
    // Change the priority to high during initial application loading.
    // It will be lowered back in app ui constructor.
    // If priority < high, app framework will lower it to background since
    // SysAp is started up as a background application.
    RThread().SetProcessPriority( EPriorityHigh );
    return EikStart::RunApplication(NewApplication);
    }
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:9,代码来源:SysApApp.cpp

示例9: new

// ---------------------------------------------------------------------------
//
// ---------------------------------------------------------------------------
//
CATExtSrv* CATExtSrv::NewLC()
    {
    CATExtSrv* self = new (ELeave) CATExtSrv( EPriorityNormal );
    CleanupStack::PushL( self );
    self->ConstructL();
    self->StartL( KATExtSrvName );
    RThread().SetPriority( EPriorityNormal );
    return self;
    }
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:13,代码来源:atextsrv.cpp

示例10: TRAPD

TInt CCollector::ThreadFunc(TAny* aParams) // for sensor thread
	{
	CTrapCleanup* cleanupStack = CTrapCleanup::New();
	TRAPD(err,
			CActiveScheduler* activeScheduler = new (ELeave) CActiveScheduler;
			CleanupStack::PushL(activeScheduler);
			CActiveScheduler::Install(activeScheduler);
			CCollector* collector = (CCollector*) aParams;
			TNode* node = collector->GetNode();
			if(node->iType == TNode::EACC)
				{
					CAccelerometer* acc=NULL;
					acc = CAccelerometer::NewLC();
					collector->SetSensor(acc);
					acc->SetReceiver(collector);
					RThread().Rendezvous(KErrNone);
					CActiveScheduler::Start();
					CleanupStack::PopAndDestroy(acc);
					collector->SetSensor(NULL);
				}
			else if(node->iType == TNode::EBTECG)
				{
					CAliveECG* ecg=NULL;
					ecg = CAliveECG::NewLC(node->iAddress, node->iPort);
					collector->SetSensor(ecg);
					ecg->SetReceiver(collector);
					RThread().Rendezvous(KErrNone);
					CActiveScheduler::Start();
					CleanupStack::PopAndDestroy(ecg);
					collector->SetSensor(NULL);
				}
			else if(node->iType == TNode::EBTSPO2)
				{
					CAliveSpO2* spO2=NULL;
					spO2 = CAliveSpO2::NewLC(node->iAddress, node->iPort);
					collector->SetSensor(spO2);
					spO2->SetReceiver(collector);
					RThread().Rendezvous(KErrNone);
					CActiveScheduler::Start();
					CleanupStack::PopAndDestroy(spO2);
					collector->SetSensor(NULL);		
				}
			CleanupStack::PopAndDestroy(activeScheduler);
	);
开发者ID:kkskipper,项目名称:KNOWME,代码行数:44,代码来源:Collector.cpp

示例11: iState

// -----------------------------------------------------------------------------
// CAdvancedAudioRecordController::CAdvancedAudioRecordController
// C++ default constructor can NOT contain any code, that might leave.
// -----------------------------------------------------------------------------
//
EXPORT_C CAdvancedAudioRecordController::CAdvancedAudioRecordController()
	:	iState(EStopped),
		iAudioInput(NULL),
		iAudioResource(NULL),
		iAudioUtility(NULL),
		iSinkWritePosition(0),
		iMaxFileSize(-1)
    {
    RThread().SetPriority(EPriorityRealTime);
    }
开发者ID:kuailexs,项目名称:symbiandump-mw2,代码行数:15,代码来源:AdvancedAudioRecordController.cpp

示例12: CheckHandles

static void CheckHandles()
    {
    TInt endProcessHandleCount;
    TInt endThreadHandleCount;
    
    RThread().HandleCount(endProcessHandleCount, endThreadHandleCount);

    TEST2(TheProcessHandleCount, endProcessHandleCount);
    TEST2(TheThreadHandleCount, endThreadHandleCount);
    }
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:10,代码来源:t_sqlstartup.cpp

示例13: IsSsa_TestL

/**
@SYMTestCaseID		SYSLIB-ECOM-CT-0177
@SYMTestCaseDesc 	Check that IsSSA works when ecomsrvr has different values.
@SYMTestPriority 	High
@SYMTestActions  	Check that IsSSA returns ETrue when ecomsrvr ini does not exist.
                    Check that IsSSA returns the value in the ecomsrvr ini file when
                    the file exists.
@SYMTestExpectedResults The test must not fail.
@SYMPREQ PREQ967
*/
void IsSsa_TestL()
	{
	TInt processHandlesS = 0;
	TInt threadHandlesS = 0;
	TInt processHandlesE = 0;
	TInt threadHandlesE = 0;
	RThread().HandleCount(processHandlesS, threadHandlesS);

	TBool res;

	TestEnableDisableSsaL(TheTest, TheFs);

    /*****************************************************************/
	//test that IsSSA() returns ETrue when ecomsrvr.ini file does
	//not exist.

	//enable ssa
	EnableSsa(TheTest, TheFs);

	//test that IsSSA() returns ETrue
	CEComServer* server=CEComServer::NewLC();
	res = server->IsSSA(TheFs);
	CleanupStack::PopAndDestroy();
	ResetSsa(TheTest, TheFs);
	TEST(res);

    /*****************************************************************/
	//test that IsSSA() returns EFalse when ecomsrvr.ini file exists.

	//disable ssa
	DisableSsa(TheTest, TheFs);

	//test that IsSSA() returns EFalse
	server=CEComServer::NewLC();
	res = server->IsSSA(TheFs);
	CleanupStack::PopAndDestroy();
	ResetSsa(TheTest, TheFs);
	TEST(!res);

	RThread().HandleCount(processHandlesE, threadHandlesE);
	TEST(processHandlesS == processHandlesE);
	TEST(threadHandlesS == threadHandlesE);
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:53,代码来源:MagicServerTest.cpp

示例14: RThread

void CStsServerSession::DoRegisterMsgQueueL(const RMessage2& aMessage)
    {
    TInt result = iMsgQueue.Open(aMessage, 0);
    if (result == KErrNone)
        {
        TThreadId id = RThread().Id();
        TPckg<TThreadId> idPckg(id);
        TRAP(result,aMessage.Write(1, idPckg));
        }
    aMessage.Complete(result);
    }
开发者ID:kuailexs,项目名称:symbiandump-mw2,代码行数:11,代码来源:stsserversession.cpp

示例15: TRAP

TInt CTestStep_MMF_A2DPBLUETOOTH_SVR_U_0020::NewThread(TAny* aTestStep) 
	{
	CTestStep_MMF_A2DPBLUETOOTH_SVR_U_0020* testStep = reinterpret_cast<CTestStep_MMF_A2DPBLUETOOTH_SVR_U_0020*>(aTestStep);

	//install active scheduler for new thread
	CActiveScheduler* activeScheduler=NULL;
	activeScheduler=new(ELeave) CActiveScheduler;
	CActiveScheduler::Install(activeScheduler);
	CTrapCleanup* cleanup = CTrapCleanup::New();
	if(cleanup == NULL)
		{
		return KErrNoMemory;
		}
		
	RA2dpBTHeadsetAudioInterface aThread2A2dpBTHeadsetAudioInterface;
	TInt err = aThread2A2dpBTHeadsetAudioInterface.Connect();
	if (err)
		{
		return err;
		}
	
	CAsyncTestStepNotifier* asyncRequestHandler = NULL;
	TRAP(err,asyncRequestHandler = CAsyncTestStepNotifier::NewL(testStep));
	if (err)
		{
		return err;
		}
	TRequestStatus* status = &(asyncRequestHandler->RequestStatus());
	testStep->iError = KErrGeneral;
	//this initialize should complete much faster than the Initialize in the main thread
	aThread2A2dpBTHeadsetAudioInterface.Initialize(*testStep->iBTheadsetAddress, *status);
	asyncRequestHandler->HandleAsyncRequest();
	
	if (!testStep->iError)
		{
		//a better test would set the sample rate to a different one to that in 
		//the main thread forcing a reconfigure - but reconfiguring doesn't
		//work in GAVDP_Open on blueant headset
		err = aThread2A2dpBTHeadsetAudioInterface.SetSampleRate(KDefaultTestSampleRate);
		if (!err)
			{
			testStep->iError = KErrGeneral;
			aThread2A2dpBTHeadsetAudioInterface.OpenDevice(*status);
			asyncRequestHandler->HandleAsyncRequest();
			}
		aThread2A2dpBTHeadsetAudioInterface.Close();
		}
		
	delete activeScheduler;
	delete cleanup;
	delete asyncRequestHandler;
	RThread().Kill(KErrNone);
	return KErrNone;
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:54,代码来源:TSU_MMF_A2DPBLUETOOTH_SVR_Initialize.cpp


注:本文中的RThread函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。