1 /***************************************************************************
3 * Copyright (C) 2006 David Brodsky *
5 * This program is free software; you can redistribute it and/or *
6 * modify it under the terms of the GNU General Public License as *
7 * published by the Free Software Foundation and appearing *
8 * in the file LICENSE.GPL included in the packaging of this file. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
13 * General Public License for more details. *
15 ***************************************************************************/
20 #include <tairon/core/log.h>
22 #include "mainthread.h"
24 static unsigned int todoCounter
= 1;
26 /* {{{ signalHandler(int) */
27 static void signalHandler(int)
29 INFO("Signal caught, terminating");
31 signal(SIGINT
, SIG_DFL
);
42 MainThread
*MainThread::mainThread
= 0;
44 /* {{{ MainThread::MainThread() */
45 MainThread::MainThread() : Tairon::Core::Thread("main")
47 signal(SIGINT
, signalHandler
);
48 signal(SIGUSR1
, signalHandler
);
52 /* {{{ MainThread::~MainThread() */
53 MainThread::~MainThread()
58 /* {{{ MainThread::operationDone() */
59 void MainThread::operationDone()
65 /* {{{ MainThread::operationInProgress() */
66 void MainThread::operationInProgress()
72 /* {{{ MainThread::run() */
73 void *MainThread::run()
76 waitAndCallFunctors(1, 0);
86 }; // namespace Tairent
88 // vim: ai sw=4 ts=4 noet fdm=marker