Bosma/Scheduler

error when using Bosma::Scheduler in the class

Opened this issue · 0 comments

I try to using Bosma::Scheduler in my application, I have a TestScheduler define as follow:
`
class TestScheduler : public QWidget
{
Q_OBJECT

public:
TestScheduler(QWidget* parent = 0);
~TestScheduler();
void print();
}
here is it implementation, very simple:
TestScheduler::TestScheduler(QWidget* parent) : QWidget(parent)
{
Bosma::Scheduler s(4);
s.at("2021-05-26 15:50:00", &TestScheduler::print, this);
}

void TestScheduler::print()
{
qDebug() << "ok";
}
`
I run this above but has an error, scheduler do not working. I try to investigate this and found that an error has occupied in the file "ctpl_stl.h", I try print some simple string, the order of thread pool do as follow:

  • init threads
  • resize
  • push function
    after that thread pool do destroy selt, so that scheduler do not working. Please solve this problem because now I only use Bosma::Scheduler in the main function, thank in advanced!!!