fix sigsev at program close by adding destructor at program close
This commit is contained in:
parent
d7da698fca
commit
268c532745
2 changed files with 8 additions and 1 deletions
|
|
@ -42,10 +42,10 @@ using OutputType = pl::SimOutputArtifact;
|
||||||
|
|
||||||
class TaskInterface {
|
class TaskInterface {
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
TaskInterface(size_t buffer_size);
|
TaskInterface(size_t buffer_size);
|
||||||
|
~TaskInterface();
|
||||||
|
|
||||||
void wait_for_fresh();
|
void wait_for_fresh();
|
||||||
void wait_for_finished();
|
void wait_for_finished();
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,13 @@ TaskInterface::TaskInterface(size_t buffer_size) {
|
||||||
this->buffer_size = buffer_size;
|
this->buffer_size = buffer_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TaskInterface::~TaskInterface() {
|
||||||
|
bool empty = false;
|
||||||
|
while (!empty) this->pop_fresh(empty);
|
||||||
|
empty = false;
|
||||||
|
while (!empty) this->pop_finished(empty);
|
||||||
|
}
|
||||||
|
|
||||||
void TaskInterface::push_fresh(std::unique_ptr<InputType> task) {
|
void TaskInterface::push_fresh(std::unique_ptr<InputType> task) {
|
||||||
|
|
||||||
// lock the queue and insert into it
|
// lock the queue and insert into it
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue