public function updateCrawlerStatus($PageInfo, $abort_reason = null, $first_content_url = null, $last_request_time = null)
  {
    PHPCrawlerBenchmark::start("updating_crawler_status");
    
    // Set semaphore/lock if
    if ($this->lock_status_updates == true)
    {
      $sem_key = sem_get($this->crawler_uniqid);
      sem_acquire($sem_key);
    }
    
    // Get current Status
    $crawler_status = $this->getCrawlerStatus();
    
    // Update status
    if ($PageInfo != null)
    {
      // Increase number of followed links
      $crawler_status->links_followed++;
      
      // Increase documents_received-counter
      if ($PageInfo->received == true) $crawler_status->documents_received++;
        
      // Increase bytes-counter
      $crawler_status->bytes_received += $PageInfo->bytes_received + $PageInfo->header_bytes_received;
      
      // Benchmarks
      if ($PageInfo->error_occured == false)
      {
        // server connect time
        $crawler_status->sum_server_connect_time += $PageInfo->server_connect_time;
        $crawler_status->sum_server_connects++;
        
        // server response time
        $crawler_status->sum_server_response_time += $PageInfo->server_response_time;
        $crawler_status->sum_server_responses++;
        
        // data transfer time
        $crawler_status->sum_data_transfer_time += $PageInfo->data_transfer_time;
        
        // unbuffered bytes read
        $crawler_status->unbuffered_bytes_read += $PageInfo->unbuffered_bytes_read;
      }
    }
    
    // Set abortreason
    if ($abort_reason !== null) $crawler_status->abort_reason = $abort_reason;
    
    // Set first_content_url
    if ($first_content_url !== null) $crawler_status->first_content_url = $first_content_url;
    
    // Set last request-time
    if ($last_request_time !== null) $crawler_status->last_request_time = $last_request_time;
    
    // Write crawler-status back
    $this->setCrawlerStatus($crawler_status);
    
    // Remove semaphore/lock
    if ($this->lock_status_updates == true)
    {
      sem_release($sem_key);
    }
    
    PHPCrawlerBenchmark::stop("updating_crawler_status");
  }