00001
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #include "GizmodThread.hpp"
00030 #include "GizmoEventLIRC.hpp"
00031 #include "../libH/Debug.hpp"
00032 #include "../libH/Exception.hpp"
00033 #include "../libH/UtilTime.hpp"
00034 #include <boost/shared_ptr.hpp>
00035 #include <boost/thread/thread.hpp>
00036
00037 using namespace std;
00038 using namespace boost;
00039 using namespace H;
00040 using namespace Gizmod;
00041
00043
00045
00047
00049
00051
00053
00057 GizmodThread::GizmodThread(boost::python::object ThreadFunction) : mThreadProc(this) {
00058 mThreadFunction = ThreadFunction;
00059 }
00060
00064 GizmodThread::~GizmodThread() {
00065 }
00066
00068
00070
00074 void GizmodThread::create() {
00075 cdbg4 << "GizmodThread :: create" << endl;
00076 boost::thread thrd(mThreadProc);
00077 }
00078
00082 void GizmodThread::threadProc() {
00083 cdbg4 << "GizmodThread :: Calling Python threadFunction" << endl;
00084
00085
00086 mThreadFunction();
00087
00088 cdbg4 << "GizmodThread :: Python threadFunction exited." << endl;
00089 }