XBMCMove 1.0
Controlar o XBMC com gestos

Thread.cpp

Go to the documentation of this file.
00001 #include "Thread.h"
00002 
00003 Thread::Thread() {
00004 }
00005 
00006 Thread::~Thread() {
00007 
00008 }
00009 
00010 /* static */
00011 void *Thread::entryPoint(void *pthis) {
00012         Thread *ptr = static_cast<Thread *>(pthis);
00013         ptr->run();
00014 }
00015 
00016 void Thread::Start() {
00017         int nRet;
00018 
00019         if (pthread_create(&m_threadId, NULL, entryPoint, this) != 0) {
00020                 // throw an error
00021         }
00022 }
00023 
00024 void Thread::Wait() {
00025         if (pthread_join(m_threadId, NULL) != 0) {
00026                 // throw an error
00027         }
00028 }
00029 
00030 void Thread::Abort() {
00031         if (pthread_cancel(m_threadId) != 0) {
00032                 // throw an error
00033         }
00034 }
00035 
00036 void Thread::Detach() {
00037         if (pthread_detach(m_threadId) != 0) {
00038                 // throw an error
00039         }
00040 }
00041 
00042 pthread_t Thread::GetId() {
00043         return m_threadId;
00044 }
 All Classes Files Functions Variables Defines