• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ RThread函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: name

void CAsyncTest::ConstructL()
	{	
	TPtrC name(RThread().Name());
	iTest = new(ELeave) RTest(name);	
	iTest->Start(_L("T_CAsyncTest"));
	CreateNamedDbL();
	TRequestStatus *pS = &iStatus;
	User::RequestComplete(pS, KErrNone);
	SetActive();
	CActiveScheduler::Start();
	}
开发者ID:Esclapion,项目名称:qt-mobility,代码行数:11,代码来源:t_casynctest.cpp


示例17: OOMCreateDeleteTest

/**
@SYMTestCaseID          SYSLIB-ECOM-CT-0756
@SYMTestCaseDesc	    OOM Test for create and delete of CBackUpNotifier
@SYMTestPriority 	    High
@SYMTestActions  	    Check for handle leak after deletion of object.
@SYMTestExpectedResults The test must not fail.
@SYMREQ                 REQ0000
*/
LOCAL_C void OOMCreateDeleteTest()
	{
	test.Next(_L(" @SYMTestCaseID:SYSLIB-ECOM-CT-0756 OOM CreateDeleteTest "));
	TInt err;
	TInt failAt = 1;
	__UNUSED_VAR(failAt);

	CBackUpNotifierTest* theTest = NULL;

	do
		{
		__UHEAP_MARK;
  		// find out the number of open handles
		TInt startProcessHandleCount;
		TInt startThreadHandleCount;
		RThread().HandleCount(startProcessHandleCount, startThreadHandleCount);

		__UHEAP_SETFAIL(RHeap::EDeterministic, failAt++);

		TRAP(err, theTest = CBackUpNotifierTest::NewL());

		__UHEAP_SETFAIL(RHeap::ENone, 0);

		delete theTest;
		theTest = NULL;

		// check that no handles have leaked
		TInt endProcessHandleCount;
		TInt endThreadHandleCount;
		RThread().HandleCount(endProcessHandleCount, endThreadHandleCount);

		test(startProcessHandleCount == endProcessHandleCount);
		test(startThreadHandleCount  == endThreadHandleCount);

		__UHEAP_MARKEND;
		}
	while(err == KErrNoMemory);

	test.Printf(_L("- Succeeded at heap failure rate of %i\n"), failAt);
	test(err == KErrNone);
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:49,代码来源:t_BackUpNotifier.cpp


示例18: OstTraceFunctionEntry1

    void CUT_PBASE_T_USBDI_1231::ConstructL()
        {
        OstTraceFunctionEntry1( CUT_PBASE_T_USBDI_1231_CONSTRUCTL_ENTRY, this );
        OstTrace1(TRACE_NORMAL, CUT_PBASE_T_USBDI_1231_CUT_PBASE_T_USBDI_1231, "====> Constructor entry priority = %d", RThread().Priority());

        // Collect existing thread priority (to reinstate later)
        iPriority = RThread().Priority();

        iTestDevice = new RUsbDeviceA(this);
        BaseConstructL();
        OstTraceFunctionExit1( CUT_PBASE_T_USBDI_1231_CONSTRUCTL_EXIT, this );
        }
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:12,代码来源:PBASE-T_USBDI-1231.cpp


示例19: DoBasicTestL

/**
Wrapper function to call all test functions
@param		aTestFunctionL pointer to test function
@param		aTestDesc test function name
*/
LOCAL_C void DoBasicTestL(ClassFuncPtrL aTestFunctionL, const TDesC& aTestDesc)
{
    TheTest.Next(aTestDesc);
    __UHEAP_MARK;
    // find out the number of open handles
    TInt startProcessHandleCount;
    TInt startThreadHandleCount;
    RThread().HandleCount(startProcessHandleCount, startThreadHandleCount);

    aTestFunctionL();

    // check that no handles have leaked
    TInt endProcessHandleCount;
    TInt endThreadHandleCount;
    RThread().HandleCount(endProcessHandleCount, endThreadHandleCount);

    TESTL(startProcessHandleCount == endProcessHandleCount);
    TESTL(startThreadHandleCount  == endThreadHandleCount);

    __UHEAP_MARKEND;
}
开发者ID:kuailexs,项目名称:symbiandump-os2,代码行数:26,代码来源:t_driveinfo.cpp


示例20: MainL

//
// MainL
//
// Create the engine and the communications interface and start the active scheduler
//
void MainL()
{
	RProcess().SetPriority(EPriorityHigh);
	RThread().SetPriority(EPriorityAbsoluteHigh);
	
	TInt sid = RProcess().SecureId();
		
	//TrkIO->PrintToScreen(_L("Welcome to TrkServer for Trk\r\n"));
	//TrkIO->PrintToScreen(_L("Press 'Q' to quit.\r\n\r\n"));

	CActiveScheduler::Start();
}
开发者ID:fedor4ever,项目名称:devicedbgsrvs,代码行数:17,代码来源:trkserverconsole.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ RUASSERT函数代码示例发布时间:2022-05-30
下一篇:
C++ RT_ZERO函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap