X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/b92547a5de3a3fb4f14a2bea4a4e776b8da3cb5c..561dba59a06d7f7cc5614b1648484e439aebb771:/Server/src/runnable.cpp diff --git a/Server/src/runnable.cpp b/Server/src/runnable.cpp index 0439ca0..c134b83 100644 --- a/Server/src/runnable.cpp +++ b/Server/src/runnable.cpp @@ -26,7 +26,7 @@ // #include "plaqui/server/runnable.h" -#include +#include #include #ifdef DEBUG # include @@ -40,30 +40,34 @@ namespace Server { Runnable::~Runnable(void) { #ifdef DEBUG - cerr << __FILE__ << ": destructor(this = " << this << ")" + cerr << __FILE__ << "(" << __LINE__ << ")" + << ": destructor(this = " << this << ")" << endl; #endif // DEBUG } Runnable::Runnable(void): thread(0), stop(false) { #ifdef DEBUG - cerr << __FILE__ << ": constructor." << endl; + cerr << __FILE__ << "(" << __LINE__ << ")" + << ": constructor." << endl; #endif // DEBUG } void Runnable::static_run(Runnable* runner) { #ifdef DEBUG - cerr << __FILE__ << ": static_run(runner = " << runner << ")" + cerr << __FILE__ << "(" << __LINE__ << ")" + << ": static_run(runner = " << runner << ")" << endl; #endif // DEBUG runner->real_run(); - runner->signal_finished().emit(); + runner->finished(); delete runner; } void Runnable::run(bool detach) { #ifdef DEBUG - cerr << __FILE__ << ": run(detach = " << detach << ")" << endl; + cerr << __FILE__ << "(" << __LINE__ << ")" + << ": run(detach = " << detach << ")" << endl; #endif // DEBUG // Si vamos a correr la tarea en un thread. if (detach) { @@ -81,7 +85,8 @@ void Runnable::run(bool detach) { void Runnable::finish(bool attach) { #ifdef DEBUG - cerr << __FILE__ << ": finish(attach = " << attach << ")" << endl; + cerr << __FILE__ << "(" << __LINE__ << ")" + << ": finish(attach = " << attach << ")" << endl; #endif // DEBUG stop = true; if (attach) { @@ -93,6 +98,10 @@ Runnable::SignalFinished& Runnable::signal_finished(void) { return finished; } +Runnable::SignalError& Runnable::signal_error(void) { + return error; +} + } // namespace Server } // namespace PlaQui