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


C++ ObjectHandle::commID方法代码示例

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


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

示例1: NativeProcess

int
main()
{
    NativeProcess();

    SysStatus rc;
    ObjectHandle oh;

    UsrTstRef ref = UsrTst::Create();

    rc = DREF(ref)->giveAccessByServer(oh, _KERNEL_PID);
    tassert(_SUCCESS(rc), err_printf("woops\n"));
    printf("testDisabledIPC: calling kernel with oh %lx %lx\n",
	   oh.commID(), oh.xhandle());
    Scheduler::Disable();
    ALLOW_PRIMITIVE_PPC();
    DREFGOBJ(TheProcessRef)->testUserIPC(oh);
    UN_ALLOW_PRIMITIVE_PPC();
    Scheduler::Enable();
    printf("testDisabledIPC: done calling kernel\n");
    for (uval i = 0; i < 20; i++) {
	printf("testDisabledIPC: sleeping (%ld)\n", i);
	Scheduler::DelayMicrosecs(5000);
    }
    printf("testDisabledIPC: terminating\n");
    return 0;
}
开发者ID:jimix,项目名称:k42,代码行数:27,代码来源:testDisabledIPC.C

示例2: _SERROR

/* static */ SysStatus
RegionReplicated::_CreateFixedLenExtDyn(uval& regionVaddr, uval regionSize,
					uval alignmentreq, ObjectHandle frOH,
					uval fileOffset, uval accessreq,
					XHandle target, ObjectHandle tsOH,
					RegionType::Type regionType,
					__CALLER_PID callerPID)
{
    RegionRef ref;
    ProcessRef pref=0;
    SysStatus rc;
    FCMRef fcmRef;
    TypeID type;
    ObjRef objRef;
    FRRef frRef;

    rc = RegionDefault::PrefFromTarget(target, callerPID, pref);
    _IF_FAILURE_RET(rc);

    rc = XHandleTrans::XHToInternal(frOH.xhandle(), callerPID,
				    MetaObj::attach, objRef, type);
    tassertWrn(_SUCCESS(rc), "RegionReplicated failed XHToInternal\n");
    _IF_FAILURE_RET(rc);

    // verify that type is of FRComp - we'd really like just FR
// FIXMEXX talk to Orran, the brilliant, charming, ..
    if (!MetaFR::isBaseOf(type)) {
	tassertWrn(0, "object handle <%lx,%lx> not of correct type\n",
		   frOH.commID(), frOH.xhandle());
	return _SERROR(1542, 0, EINVAL);
    }

    //FIXME check xobj to make sure it matches our processID

    frRef = (FRRef)objRef;

    rc = RegionReplicated::CreateFixedLen(
	ref, pref, regionVaddr,
	regionSize, alignmentreq, frRef, fileOffset,
	(AccessMode::mode)accessreq);

    // FIXME: Kludge for enabling dyn-switch
#if 0
    CObjRoot *partitionedFCMRoot = 0;
    rc = FCMPartitionedTrivial::Create(partitionedFCMRoot, fcmRef, regionSize,
				       /* number of cache lines per rep */ 256,
				       /* associativity of each line */    4);
    tassert(_SUCCESS(rc), err_printf("Replicated Trivial fcm create\n"));

    PMRef pmRef;
    rc = DREF(pref)->getPM(pmRef);
    tassert(_SUCCESS(rc), ;);
开发者ID:BillTheBest,项目名称:k42,代码行数:52,代码来源:RegionReplicated.C


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