コード例 #1
0
 /**
  * Come here to get your number in the requests line!
  *
  * @param Position $pos position object to populate with prev position and new position
  * @return bool sucess of getting the position in the queue
  */
 public function getPositionInLine(Position &$pos)
 {
     if ($this->_positionQueue->acquire()) {
         $pos->setup(MemoryData::getLastPosition(), MemoryData::getNewPosition());
         $this->_positionQueue->release();
         return true;
     } else {
         return false;
     }
 }