Removed hard unit tests for executor && fixed another tests

git-svn-id: svn://db.shs.com.ru/pip@890 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
4 changed files with 17 additions and 172 deletions

View File

@@ -20,15 +20,13 @@ PIOBJECT(TestUtil)
public:
double threadStartTime;
PIThread* thread = new PIThread();
StdFunctionThreadFuncAdapter* adapter = nullptr;
volatile bool isRunning;
std::function<void()> adapterFunctionDefault;
bool createThread(const std::function<void()>& fun = nullptr, PIThread* thread_ = nullptr) {
adapter = new StdFunctionThreadFuncAdapter(fun == nullptr ? adapterFunctionDefault : fun);
std::function<void()> actualFun = fun == nullptr ? adapterFunctionDefault : fun;
if (thread_ == nullptr) thread_ = thread;
adapter->registerToInvoke(thread_);
thread_->startOnce();
thread_->startOnce([=](void*){ actualFun(); });
return waitThread(thread_);
}