virtual size_t run( void ) { for(;;) { CountPtr< JobQueue::Job > job = q->getJob(); if( size_t(-1) == job->work( q ) ) return 0; Thread::yield(); } }
void worker( ) { for (;;) { Request r(myJobQueue.getJob( )); // Do something with the job... } }