本文整理汇总了C++中ObjectHandle::pid方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectHandle::pid方法的具体用法?C++ ObjectHandle::pid怎么用?C++ ObjectHandle::pid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectHandle
的用法示例。
在下文中一共展示了ObjectHandle::pid方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DREFGOBJ
SysStatus
SysVMessagesClient::getCallBackOH(ObjectHandle& oh, void*& blockKey)
{
ProcessID pid;
SysStatus rc;
pid = DREFGOBJ(TheProcessRef)->getPID();
if (pid != callBackOH.pid()) {
/* either we've never initialized or
* this is a fork child and we need
* a new call back oh.
*/
ProcessID serverPID;
ObjectHandle serverOH;
StubSysVMessages::__Get__metaoh(serverOH);
passertMsg(!serverOH.invalid(), "No SysVMessages server\n");
serverPID=serverOH.pid();
/*
* make oh to this object for async callback
*/
rc = giveAccessByServer(callBackOH, serverPID);
passertMsg(_SUCCESS(rc), "giveAccessByServer failed %ld\n", rc);
}
oh = callBackOH;
blockKey = (void*)obj;
return 0;
}
示例2: devStub
SysStatus
CreateDevice(ObjectHandle dirOH,
const char *name, mode_t mode, unsigned int major,
unsigned int minor, ObjectHandle &device,
void* &devData)
{
SysStatus rc = 0;
const mode_t perm= S_IFCHR|S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH;
StubDevFSRemote devStub(StubBaseObj::UNINITIALIZED);
ObjectHandle serverOH;
ObjectHandle devfsServer;
rc = DREFGOBJ(TheTypeMgrRef)->getTypeHdlr(StubDevFSRemote::typeID(),
devfsServer);
_IF_FAILURE_RET(rc);
CharDevOpenerRef cdoRef;
CharDevOpener::charDevs->acquireLock();
if (CharDevOpener::charDevs->locked_find(MKDEV(major,minor),cdoRef)) {
rc = DREF(cdoRef)->giveAccessSetClientData(serverOH,
devfsServer.pid(),
MetaObj::controlAccess,
MetaObj::none);
} else {
rc = CharDevOpener::Create(major, minor, devfsServer.pid(),
cdoRef, serverOH);
CharDevOpener::charDevs->locked_add(MKDEV(major,minor), cdoRef);
}
CharDevOpener::charDevs->releaseLock();
_IF_FAILURE_RET(rc);
rc = devStub._CreateNode((char*)name, perm, dirOH, serverOH,
new_encode_dev(MKDEV(major,minor)), device);
tassertRC(rc,"device node creation\n");
return 0;
}