• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ recursive_mutex类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ref_ptr类代码示例发布时间:2022-05-31
下一篇:
C++ rectangle类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap