//
#include "plaqui/server/runnable.h"
-#include <sigc++/class_slot.h>
+#include <sigc++/slot.h>
#include <glibmm/thread.h>
#ifdef DEBUG
# include <iostream>
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) {
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) {
return finished;
}
+Runnable::SignalError& Runnable::signal_error(void) {
+ return error;
+}
+
} // namespace Server
} // namespace PlaQui