本文整理汇总了C++中ACE_Token_Proxy::name方法的典型用法代码示例。如果您正苦于以下问题:C++ ACE_Token_Proxy::name方法的具体用法?C++ ACE_Token_Proxy::name怎么用?C++ ACE_Token_Proxy::name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ACE_Token_Proxy
的用法示例。
在下文中一共展示了ACE_Token_Proxy::name方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: token_name
int
ACE_Token_Collection::is_member (const ACE_Token_Proxy &token)
{
ACE_TRACE ("ACE_Token_Collection::is_member");
TOKEN_NAME token_name (token.name ());
return collection_.find (token_name) == 0;
}
示例2: while
static void *
run_thread (void *vp)
{
ACE_Token_Proxy *collection = (ACE_Token_Proxy *) vp;
int count = iterations;
while (count--)
{
if (collection->acquire () == -1)
{
if (ACE_OS::last_error () == EDEADLK)
{
ACE_DEBUG ((LM_DEBUG, "deadlock detected in acquire"));
continue;
}
ACE_ERROR ((LM_ERROR, "(%t) %p acquire failed\n","run_thread"));
return (void *) -1;
}
ACE_DEBUG ((LM_DEBUG, "(%t) %s acquired.\n", collection->name ()));
if (collection->renew () == -1)
{
if (ACE_OS::last_error () == EDEADLK)
{
ACE_DEBUG ((LM_DEBUG, "deadlock detected"));
goto deadlock;
}
ACE_ERROR ((LM_ERROR, "(%t) %p renew failed\n","run_thread"));
return (void *) -1;
}
ACE_DEBUG ((LM_DEBUG, "(%t) %s renewed.\n", collection->name ()));
deadlock:
if (collection->release () == -1)
{
ACE_ERROR ((LM_ERROR, "(%t) %p release failed\n","run_thread"));
return (void *) -1;
}
ACE_DEBUG ((LM_DEBUG, "(%t) %s released.\n", collection->name ()));
}
ACE_DEBUG ((LM_DEBUG, "(%t) thread exiting.\n"));
return 0;
}
示例3: name
int
ACE_Token_Collection::insert (ACE_Token_Proxy &new_token)
{
ACE_TRACE ("ACE_Token_Collection::insert");
TOKEN_NAME name (new_token.name ());
// Check if the new_proxy is already in the list.
if (collection_.find (name) == 1)
// One already exists, so fail.
return -1;
// Clone the new token.
ACE_Token_Proxy *temp = new_token.clone ();
if (collection_.bind (name, temp) == -1)
ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("bind failed\n")), -1);
return 0;
}