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


C++ TApaTask::ThreadId方法代码示例

本文整理汇总了C++中TApaTask::ThreadId方法的典型用法代码示例。如果您正苦于以下问题:C++ TApaTask::ThreadId方法的具体用法?C++ TApaTask::ThreadId怎么用?C++ TApaTask::ThreadId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TApaTask的用法示例。


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

示例1: CheckKeyDownPermissionL

// --------------------------------------------------------------------------
// Check whether client key event request can be executed
// --------------------------------------------------------------------------
void CAknCompaSrvSession::CheckKeyDownPermissionL(const RMessage2& aMessage)
    {
    // We try to increase security by allowing only foreground application
    // to set key down. As the simulated key events are sent to the
    // foreground application by window server, the application is
    // sending a key event to itself.

    // Granted if client has ECapabilitySwEvent or request is coming from
    // EikSrv. TApaTaskList won't report EikSrv in foreground though
    // it's displaying a note.
    if (!aMessage.HasCapability(ECapabilitySwEvent) &&
        !CAknCompaServer::IsGlobalUiSrv(aMessage))
        {
        // Allow key down only from a foreground task
        TApaTaskList tasklist(Server().WsSession());
        TApaTask foregroundTask = tasklist.FindByPos(0);

        RThread thread;
        User::LeaveIfError(thread.Open(foregroundTask.ThreadId()));
        TSecurityPolicy securityPolicy(thread.SecureId());
        thread.Close();

        if (!securityPolicy.CheckPolicy(aMessage))
            {
            User::Leave(KErrPermissionDenied);
            }
        }
    }
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:31,代码来源:akncompaserver.cpp

示例2: KillApplicationL

	EXPORT_C void KillApplicationL(RWsSession& aWs, TUid aUid, TInt aRetryInterval )
	{
		TTime wait_until; wait_until.HomeTime();
		wait_until+=TTimeIntervalSeconds(15);
	
		TApaTaskList taskList( aWs );

		for(;;) {
			TApaTask task = taskList.FindApp(aUid);
			if(! task.Exists()) {
				break;
			}
			TTime now; now.HomeTime();
			if (now < wait_until) {
				task.EndTask();
				//DebugMsg(_L("waiting..."), aDebugLog);
				User::After(TTimeIntervalMicroSeconds32(aRetryInterval*1000) );
			} else {
				break;
			}
		}
		TApaTask task = taskList.FindApp(aUid);
		if( task.Exists()) {
#ifdef __S60V3__
			task.KillTask();
#else
			RThread t;
			if (t.Open(task.ThreadId())==KErrNone) {
				//DebugMsg(_L("killing"), aDebugLog);
				t.Kill(2003);
				t.Close();
			}
#endif
		}
	}
开发者ID:flaithbheartaigh,项目名称:jaikuengine-mobile-client,代码行数:35,代码来源:cc_processmanagement.cpp

示例3: Start

void COomAppCloseWatcher::Start(const TApaTask& aTask)
    {
    FUNC_LOG;

    if (!IsActive())
        {
        TInt err = iThread.Open(aTask.ThreadId());
        if (err == KErrNone)
            {
            iOriginalProcessPriority = iThread.ProcessPriority();
            iThread.SetProcessPriority(EPriorityForeground);
            iThread.Logon(iStatus);
            SetActive();
            }
        else
            {
            TRequestStatus* s = &iStatus;
            User::RequestComplete(s, err);
            SetActive();
            }
        }
    }
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:22,代码来源:oomappclosewatcher.cpp


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