File: run.cc

package info (click to toggle)
crossroads 2.65-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 2,664 kB
  • ctags: 355
  • sloc: cpp: 4,212; perl: 1,658; xml: 269; makefile: 186; sh: 46
file content (25 lines) | stat: -rw-r--r-- 463 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include "thread"
#include "sys/sys"

void *Thread::_run (void *data) {
    Thread *t = (Thread*) data;

    debugmsg(Mstr("Thread: starting run\n"));
    Threadlist::enregister();    
    try {
	t->execute();
    } catch (Error const &e) {
	lock(&cerr);
	cerr << e.what() << "\n";
	unlock(&cerr);
    }
    Threadlist::deregister();
    debugmsg(Mstr("Thread: ending run\n"));

    // Cleanups
    delete (t);

    // To satisfy the prototype
    return (0);
}