src/SerifHTTPServer/SerifWorkQueue.cpp
// This is what the SerifWorkQueue's thread runs:

This is what the SerifWorkQueue's thread runs.
This is what the SerifWorkQueue ' s thread runs .
void SerifWorkQueue::run() {
	if (!loadDocumentDriver() || !loadPatternSets()) {
		return;
	}
	while (true) {
		std::cerr << "[WorkQueue] Waiting for a task." << std::endl;
		_status = "Waiting for a task.";
		Task_ptr task = getNextTask();
		if (!task) break; 
		std::cerr << "[WorkQueue] Performing a task..." << std::endl;
		_status = "Performing a task";
		if (PatternSetTask_ptr psTask = boost::dynamic_pointer_cast<PatternSetTask>(task)) {
			if (psTask->run(_patternSets))
				++_num_tasks_processed;
			else
				++_num_tasks_failed;
		} else {
			if (task->run(_documentDriver))
				++_num_tasks_processed;
			else
				++_num_tasks_failed;
		}
		_throughput_including_load_time = _documentDriver->getThroughput(true);
		_throughput_excluding_load_time = _documentDriver->getThroughput(false);
		recordMemoryUsage();
	}
	_tasks_ready.notify_one();
    _initialized.notify_one();
	_shutdown_complete.notify_one();
}
void SerifWorkQueue :: run ( ) { if ( ! loadDocumentDriver ( ) || ! loadPatternSets ( ) ) { return ; } while ( true ) { std :: cerr << " " << std :: endl ; _status = " " ; Task_ptr task = getNextTask ( ) ; if ( ! task ) break ; std :: cerr << " " << std :: endl ; _status = " " ; if ( PatternSetTask_ptr psTask = boost :: dynamic_pointer_cast < PatternSetTask > ( task ) ) { if ( psTask -> run ( _patternSets ) ) ++ _num_tasks_processed ; else ++ _num_tasks_failed ; } else { if ( task -> run ( _documentDriver ) ) ++ _num_tasks_processed ; else ++ _num_tasks_failed ; } _throughput_including_load_time = _documentDriver -> getThroughput ( true ) ; _throughput_excluding_load_time = _documentDriver -> getThroughput ( false ) ; recordMemoryUsage ( ) ; } _tasks_ready . notify_one ( ) ; _initialized . notify_one ( ) ; _shutdown_complete . notify_one ( ) ; }
This is what the SerifWorkQueue's thread runs:
This is what the SerifWorkQueue ' s thread runs :
// Shutdown was requested.
 // Make sure no condition variables are blocking threads -- otherwise, 
 // destroying them will have undefined effects.
 // Record the fact that we've shut down (in case the user wants to call
 // shutdown(true)).
