Brief description of class still missing. More...
#include <PThread.h>
Public Member Functions | |
| std::vector< TraceBug * > * | bugStack () |
| EventLoop * | eventLoop () const |
| pthread_t | id () const |
| PThread () | |
| void | setEventLoop (EventLoop *l) |
| std::vector< const TraceStamp * > * | stack () |
| void | start () |
| void | stop () |
| void | wait () |
| virtual | ~PThread () |
Static Public Member Functions | |
| static std::list< std::vector < TraceBug * > * > | bugStacks () |
| static PThread * | currentThread () |
| static void | init () |
| static void | lockThreads () |
| static std::list< std::vector < const TraceStamp * > * > | stacks () |
| static void | unlockThreads () |
Protected Member Functions | |
| virtual void | run ()=0 |
Brief description of class still missing.
Full description of class still missing
{
_eventLoop=0;
}
| virtual GpCoreTools::PThread::~PThread | ( | ) | [inline, virtual] |
{}
| std::vector<TraceBug *>* GpCoreTools::PThread::bugStack | ( | ) | [inline] |
Referenced by GpCoreTools::TraceBug::TraceBug().
{return &_bugStack;}
| std::list< std::vector< TraceBug * > * > GpCoreTools::PThread::bugStacks | ( | ) | [static] |
References GpCoreTools::TraceBug::mainStack().
{
std::list< std::vector<TraceBug *> * > list;
list.push_back(TraceBug::mainStack());
for(std::map<pthread_t, PThread *>::iterator it=_threads.begin(); it!=_threads.end(); it++ ) {
list.push_back(it->second->bugStack());
}
return list;
}
| PThread * GpCoreTools::PThread::currentThread | ( | ) | [static] |
Referenced by GpCoreTools::EventLoop::EventLoop(), GpCoreTools::EventLoop::instance(), GpCoreTools::Trace::Trace(), and GpCoreTools::TraceBug::TraceBug().
{
pthread_mutex_lock(&_threadsMutex);
pthread_t id=pthread_self();
std::map<pthread_t, PThread *>::iterator it;
it=_threads.find(id);
PThread * t;
if(it!=_threads.end()) {
t=it->second;
} else {
t=0;
}
pthread_mutex_unlock(&_threadsMutex);
return t;
}
| EventLoop* GpCoreTools::PThread::eventLoop | ( | ) | const [inline] |
Referenced by GpCoreTools::EventLoop::instance().
{return _eventLoop;}
| pthread_t GpCoreTools::PThread::id | ( | ) | const [inline] |
{return _id;}
| void GpCoreTools::PThread::init | ( | ) | [static] |
Referenced by GpCoreTools::CoreApplication::CoreApplication().
{
assert(pthread_mutex_init(&_threadsMutex, 0)==0);
}
| static void GpCoreTools::PThread::lockThreads | ( | ) | [inline, static] |
Referenced by GpCoreTools::CoreApplication::osSignal().
{pthread_mutex_lock(&_threadsMutex);}
| virtual void GpCoreTools::PThread::run | ( | ) | [protected, pure virtual] |
Referenced by start().
| void GpCoreTools::PThread::setEventLoop | ( | EventLoop * | l | ) |
Usually never called. EventLoop's constructor does it for you. You can create only one event loop per thread.
Referenced by GpCoreTools::EventLoop::EventLoop().
{
assert(!_eventLoop);
_eventLoop=l;
}
| std::vector<const TraceStamp *>* GpCoreTools::PThread::stack | ( | ) | [inline] |
Referenced by GpCoreTools::Trace::Trace().
{return &_stack;}
| std::list< std::vector< const TraceStamp * > * > GpCoreTools::PThread::stacks | ( | ) | [static] |
References GpCoreTools::Trace::mainStack().
Referenced by GpCoreTools::CoreApplication::osSignal().
{
std::list< std::vector<const TraceStamp *> * > list;
list.push_back(Trace::mainStack());
for(std::map<pthread_t, PThread *>::iterator it=_threads.begin(); it!=_threads.end(); it++ ) {
list.push_back(it->second->stack());
}
return list;
}
| void GpCoreTools::PThread::start | ( | ) |
| void GpCoreTools::PThread::stop | ( | ) |
References GpCoreTools::EventLoop::terminate().
Referenced by CubeDaemonApplication::childInterrupted(), and GpsDaemonApplication::childInterrupted().
{
if(_eventLoop) {
_eventLoop->terminate();
}
}
| static void GpCoreTools::PThread::unlockThreads | ( | ) | [inline, static] |
Referenced by GpCoreTools::CoreApplication::osSignal().
{pthread_mutex_unlock(&_threadsMutex);}
| void GpCoreTools::PThread::wait | ( | ) |
Referenced by CubeDaemonApplication::close(), and GpsDaemonApplication::close().
{
pthread_join(_id, 0);
}