X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/212f9ae5dc8899bab8b23ed13d81c28c510db3c3..3e56bc8be121c3896356f94709f127c97956228d:/Server/src/runnable.cpp diff --git a/Server/src/runnable.cpp b/Server/src/runnable.cpp index 7079143..6d000ce 100644 --- a/Server/src/runnable.cpp +++ b/Server/src/runnable.cpp @@ -41,15 +41,14 @@ namespace Server { Runnable::~Runnable(void) { #ifdef DEBUG cerr << __FILE__ << "(" << __LINE__ << ")" - << ": destructor(this = " << this << ")" - << endl; + << ": destructor(this = " << this << ")." << endl; #endif // DEBUG } Runnable::Runnable(void): _thread(NULL), _stop(false) { #ifdef DEBUG cerr << __FILE__ << "(" << __LINE__ << ")" - << ": constructor." << endl; + << ": constructor(this = " << this << ")." << endl; #endif // DEBUG } @@ -58,7 +57,9 @@ void Runnable::static_run(Runnable* runner) { cerr << __FILE__ << "(" << __LINE__ << ")" << ": static_run(runner = " << runner << ")" << endl; #endif // DEBUG + // Corre tarea. runner->real_run(); + // Manda señal de tarea finalizada runner->_finished(); delete runner; } @@ -73,8 +74,7 @@ void Runnable::run(bool detach) { // Corremos el thread en una funcion estática para poder destruirlo al // finalizar, pasandole el puntero al objeto. _thread = Glib::Thread::create( - SigC::bind(SigC::slot(&Runnable::static_run), this), - false);//true); + SigC::bind(SigC::slot(&Runnable::static_run), this), false); // Si no corremos la tarea normalmente. } else { real_run();