File: NGMTask.cpp

package info (click to toggle)
ngmlr 0.2.7%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,844 kB
  • sloc: cpp: 10,358; sh: 127; makefile: 7
file content (30 lines) | stat: -rw-r--r-- 552 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/**
 * Contact: philipp.rescheneder@gmail.com
 */

#include "NGM.h"
#include "Log.h"

void NGMTask::FinishStage()
{
	if (!m_FinishedStage)
	{
		NGM.FinishStage(m_TID);
		m_FinishedStage = true;
	}
}

void NGMTask::Run() {
	m_FinishedStage = false;

	try {
		DoRun();
	} catch (std::bad_alloc & ex) {
		Log.Error("Exception bad_alloc occurred in thread %i. This usually means you ran out of physical or virtual memory (try ulimit -v)", m_TID);
	}
	catch (...)
	{
		Log.Error("Exception in thread %i", m_TID);
		throw;
	}
}