Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. int CCouchWorker::Run()
  2. {
  3.     for ( ; ; )
  4.     {
  5.         CouchJobInfo_t *pJob = NULL;
  6.  
  7.         // wait for a job
  8.         GJobMgr()->GetPendingJob( &pJob );
  9.  
  10.         if ( pJob == NULL )
  11.         {
  12.             // shutdown signal
  13.             break;
  14.         }
  15.  
  16.         if ( !GJobMgr()->RunJob( pJob ) )
  17.         {
  18.             continue;
  19.         }
  20.  
  21.         // notify completion
  22.         // this adds the job to the completed queue
  23.         GJobMgr()->FinishJob( pJob );
  24.     }
  25.  
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement