本文整理汇总了C++中recursive_mutex类的典型用法代码示例。如果您正苦于以下问题:C++ recursive_mutex类的具体用法?C++ recursive_mutex怎么用?C++ recursive_mutex使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了recursive_mutex类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: endRouters
vector<uint32_t>::const_iterator endRouters()
{
lock.unlock();
auto it = routers.end();
lock.unlock();
return it;
}
开发者ID:raystubbs,项目名称:NMSU-BigData-REU-NDN-Access-Control-Simulation,代码行数:7,代码来源:Coordinator.cpp
示例2: addFriend
void addFriend(SceNetAdhocctlConnectPacketS2C * packet) {
// Allocate Structure
SceNetAdhocctlPeerInfo * peer = (SceNetAdhocctlPeerInfo *)malloc(sizeof(SceNetAdhocctlPeerInfo));
// Allocated Structure
if(peer != NULL) {
// Clear Memory
memset(peer, 0, sizeof(SceNetAdhocctlPeerInfo));
// Link to existing Peers
peer->next = friends;
// Save Nickname
peer->nickname = packet->name;
// Save MAC Address
peer->mac_addr = packet->mac;
// Save IP Address
peer->ip_addr = packet->ip;
// Multithreading Lock
peerlock.lock();
// Link into Peerlist
friends = peer;
// Multithreading Unlock
peerlock.unlock();
}
}
开发者ID:KuroGami,项目名称:ppsspp,代码行数:30,代码来源:proAdhoc.cpp
示例3: producerSatisfiedAuthRequest
void producerSatisfiedAuthRequest( const Name& producer_name,
const Name& request_name,
const NdnParameterSet& credentials )
{
if( logging_enabled )
{
lock.lock();
log_file << "Producer:SatisfiedAuth" << endl
<< "{" << endl
<< " time = " << time::system_clock::now() << endl
<< " producer = " << producer_name.toUri() << endl
<< " request = " << request_name.toUri() << endl
<< " username = " <<
( ( credentials.hasParameter( "username" ) )
? credentials.getParameter( "username" )
: "none" )
<< endl
<< " password = " <<
( ( credentials.hasParameter( "password" ) )
? credentials.getParameter( "password" )
: "none" )
<< endl
<< "}" << endl;
lock.unlock();
}
}
开发者ID:raystubbs,项目名称:NMSU-BigData-REU-NDN-Access-Control-Simulation,代码行数:26,代码来源:Coordinator.cpp
示例4: routerStartedCount
size_t routerStartedCount()
{
lock.lock();
auto count = routers_started.size();
lock.unlock();
return count;
}
开发者ID:raystubbs,项目名称:NMSU-BigData-REU-NDN-Access-Control-Simulation,代码行数:7,代码来源:Coordinator.cpp
示例5: beginRouters
vector<uint32_t>::const_iterator beginRouters()
{
lock.lock();
auto it = routers.begin();
lock.unlock();
return it;
}
开发者ID:raystubbs,项目名称:NMSU-BigData-REU-NDN-Access-Control-Simulation,代码行数:7,代码来源:Coordinator.cpp
示例6: endProducers
vector<uint32_t>::const_iterator endProducers()
{
lock.lock();
auto it = producers.end();
lock.unlock();
return it;
}
开发者ID:raystubbs,项目名称:NMSU-BigData-REU-NDN-Access-Control-Simulation,代码行数:7,代码来源:Coordinator.cpp
示例7: producerStartedCount
size_t producerStartedCount()
{
lock.lock();
auto count = producers_started.size();
lock.unlock();
return count;
}
开发者ID:raystubbs,项目名称:NMSU-BigData-REU-NDN-Access-Control-Simulation,代码行数:7,代码来源:Coordinator.cpp
示例8: consumerStartedCount
size_t consumerStartedCount()
{
lock.lock();
auto count = consumers_started.size();
lock.unlock();
return count;
}
开发者ID:raystubbs,项目名称:NMSU-BigData-REU-NDN-Access-Control-Simulation,代码行数:7,代码来源:Coordinator.cpp
示例9: nodeCount
size_t nodeCount()
{
lock.lock();
auto count = routers.size();
lock.unlock();
return count;
}
开发者ID:raystubbs,项目名称:NMSU-BigData-REU-NDN-Access-Control-Simulation,代码行数:7,代码来源:Coordinator.cpp
示例10: consumerCount
size_t consumerCount()
{
lock.lock();
auto count = consumers.size();
lock.unlock();
return count;
}
开发者ID:raystubbs,项目名称:NMSU-BigData-REU-NDN-Access-Control-Simulation,代码行数:7,代码来源:Coordinator.cpp
示例11: producerCount
size_t producerCount()
{
lock.lock();
auto count = producers.size();
lock.unlock();
return count;
}
开发者ID:raystubbs,项目名称:NMSU-BigData-REU-NDN-Access-Control-Simulation,代码行数:7,代码来源:Coordinator.cpp
示例12: deleteFriendByIP
void deleteFriendByIP(uint32_t ip) {
// Previous Peer Reference
SceNetAdhocctlPeerInfo * prev = NULL;
// Peer Pointer
SceNetAdhocctlPeerInfo * peer = friends;
// Iterate Peers
for(; peer != NULL; peer = peer->next) {
// Found Peer
if(peer->ip_addr == ip) {
// Multithreading Lock
peerlock.lock();
// Unlink Left (Beginning)
if(prev == NULL)friends = peer->next;
// Unlink Left (Other)
else prev->next = peer->next;
// Multithreading Unlock
peerlock.unlock();
// Free Memory
free(peer);
// Stop Search
break;
}
// Set Previous Reference
prev = peer;
}
}
开发者ID:KuroGami,项目名称:ppsspp,代码行数:34,代码来源:proAdhoc.cpp
示例13: endConsumers
vector<uint32_t>::const_iterator endConsumers()
{
lock.lock();
auto it = consumers.end();
lock.unlock();
return it;
}
开发者ID:raystubbs,项目名称:NMSU-BigData-REU-NDN-Access-Control-Simulation,代码行数:7,代码来源:Coordinator.cpp
示例14: removeProducer
void removeProducer( uint8_t producer_instance )
{
lock.lock();
auto it = find( producers.begin(), producers.end(), producer_instance );
if( it != producers.end() )
producers.erase( it );
lock.unlock();
}
开发者ID:raystubbs,项目名称:NMSU-BigData-REU-NDN-Access-Control-Simulation,代码行数:8,代码来源:Coordinator.cpp
示例15: workerFunction
static void workerFunction(){
mMutex.lock();
cout << "Operation Started" << endl;
workerFunction(); //this goes in a no ending loop if it works. Which means we can call recousively this function from the same thread
sleep(1);
cout << "Operation Terminated" << endl;
mMutex.unlock();
}
开发者ID:Pellucid-Petrus,项目名称:Playground,代码行数:8,代码来源:threads-recursive_mutex.cpp
示例16: removeRouter
void removeRouter( uint32_t router_instance )
{
lock.lock();
auto it = find( routers.begin(), routers.end(), router_instance );
if( it != routers.end() )
routers.erase( it );
lock.unlock();
}
开发者ID:raystubbs,项目名称:NMSU-BigData-REU-NDN-Access-Control-Simulation,代码行数:8,代码来源:Coordinator.cpp
示例17: removeConsumer
void removeConsumer( uint32_t consumer_instance )
{
lock.lock();
auto it = find( consumers.begin(), consumers.end(), consumer_instance );
if( it != consumers.end() )
consumers.erase( it );
lock.unlock();
}
开发者ID:raystubbs,项目名称:NMSU-BigData-REU-NDN-Access-Control-Simulation,代码行数:8,代码来源:Coordinator.cpp
示例18: routerStopped
void routerStopped( uint32_t router_instance )
{
lock.lock();
auto it = find( routers_started.begin(),
routers_started.end(),
router_instance );
if( it != routers_started.end() )
routers_started.erase( it );
lock.unlock();
}
开发者ID:raystubbs,项目名称:NMSU-BigData-REU-NDN-Access-Control-Simulation,代码行数:10,代码来源:Coordinator.cpp
示例19: consumerStopped
void consumerStopped( uint32_t consumer_instance )
{
lock.lock();
auto it = find( consumers_started.begin(),
consumers_started.end(),
consumer_instance );
if( it != consumers_started.end() )
consumers.erase( it );
lock.unlock();
}
开发者ID:raystubbs,项目名称:NMSU-BigData-REU-NDN-Access-Control-Simulation,代码行数:10,代码来源:Coordinator.cpp
示例20: producerSigner
NdnSigner* producerSigner( const Name& producer )
{
lock.lock();
// make signer if not already available
NdnSigner* ret = &producer_signers[producer];
lock.unlock();
return ret;
}
开发者ID:raystubbs,项目名称:NMSU-BigData-REU-NDN-Access-Control-Simulation,代码行数:10,代码来源:Coordinator.cpp
注:本文中的recursive_mutex类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论