1234567891011121314151617181920212223242526272829303132333435363738394041 |
- #include "AsynchronCall.h"
- using namespace Framework;
- AsynchronCall::AsynchronCall( std::function< void() > f )
- : Thread()
- {
- 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();
- }
- void AsynchronCall::thread()
- {
- f();
- }
- void AsynchronCall::threadEnd()
- {
- if( finished )
- *finished = 1;
- delete this;
- }
|