12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- #include "AsynchronCall.h"
- using namespace Framework;
- AsynchronCall::AsynchronCall(std::function<void()> f)
- : Thread()
- {
- this->finished = 0;
- this->f = f;
- start();
- }
- AsynchronCall::AsynchronCall(const char* name, std::function<void()> f)
- : Thread()
- {
- setName(name);
- this->finished = 0;
- this->f = f;
- start();
- }
- AsynchronCall::AsynchronCall(std::function<void()> f, bool* finished)
- : Thread()
- {
- this->finished = finished;
- this->f = f;
- if (finished) finished = 0;
- start();
- }
- AsynchronCall::AsynchronCall(
- const char* name, std::function<void()> f, bool* finished)
- : Thread()
- {
- setName(name);
- this->finished = finished;
- this->f = f;
- if (finished) finished = 0;
- start();
- }
- void AsynchronCall::thread()
- {
- f();
- }
- void AsynchronCall::threadEnd()
- {
- Thread::threadEnd();
- if (finished) *finished = 1;
- release();
- }
|