Ejemplo n.º 1
0
unsigned int pmdEDUMgr::_getEDUCount ( int property )
{
   unsigned int eduCount = 0 ;
   std::map<EDUID, pmdEDUCB*>::iterator it ;

   /*******************CRITICAL SECTION ********************/
   _mutex.get_shared() ;
   for ( it = _runQueue.begin () ; it != _runQueue.end () ; ++it )
   {
      if ( ((EDU_SYSTEM & property) && _isSystemEDU( it->first ))
         || ((EDU_USER & property) && !_isSystemEDU( it->first )) )
      {
         ++eduCount ;
      }
   }

   for ( it = _idleQueue.begin () ; it != _idleQueue.end () ; ++it )
   {
      if ( EDU_USER & property )
      {
         ++eduCount ;
      }
   }
   _mutex.release_shared() ;
   /******************END CRITICAL SECTION******************/
   return eduCount ;
}
Ejemplo n.º 2
0
// block all new request and attempt to terminate existing requests
int pmdEDUMgr::_forceEDUs ( int property )
{
   std::map<EDUID, pmdEDUCB*>::iterator it ;

   /*******************CRITICAL SECTION ********************/
   _mutex.get() ;
   // send terminate request to everyone
   for ( it = _runQueue.begin () ; it != _runQueue.end () ; ++it )
   {
      if ( ((EDU_SYSTEM & property) && _isSystemEDU( it->first ))
         || ((EDU_USER & property) && !_isSystemEDU( it->first )) )
      {
         ( *it ).second->force () ;
         PD_LOG ( PDDEBUG, "force edu[ID:%lld]", it->first ) ;
      }
   }

   for ( it = _idleQueue.begin () ; it != _idleQueue.end () ; ++it )
   {
      if ( EDU_USER & property )
      {
         ( *it ).second->force () ;
      }
   }
   _mutex.release() ;
   /******************END CRITICAL SECTION******************/
   return EDB_OK ;
}
Ejemplo n.º 3
0
 bool isSystemEDU ( EDUID eduID )
 {
     bool isSys = false ;
     _mutex.get_shared () ;
     isSys = _isSystemEDU ( eduID ) ;
     _mutex.release_shared () ;
     return isSys ;
 }