crossroads

Git mirror of https://crossroads.e-tunity.com/
git clone git://git.finwo.net/app/crossroads
Log | Files | Refs | LICENSE

run.cc (549B)


      1 #include "thread"
      2 #include "sys/sys"
      3 
      4 void *Thread::_run (void *data) {
      5     Thread *t = (Thread*) data;
      6 
      7     debugmsg("Thread: starting run\n");
      8     Threadlist::enregister();    
      9     try {
     10 	t->execute();
     11     } catch (Error const &e) {
     12 	mutex_lock(&cerr);
     13 	if (config.prefixtimestamp()) {
     14 	    Timestamp tm;
     15 	    cerr << tm.desc() << ' ';
     16 	}
     17 	cerr << e.what() << "\n";
     18 	mutex_unlock(&cerr);
     19     }
     20     Threadlist::deregister();
     21     debugmsg("Thread: ending run\n");
     22 
     23     // Cleanups
     24     delete (t);
     25 
     26     // To satisfy the prototype
     27     return (0);
     28 }
     29