Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
QThreadPrivate Class Reference

#include <qthread_p.h>

Public Member Functions

 QThreadPrivate ()
 
 ~QThreadPrivate ()
 

Static Public Member Functions

static void * start (void *arg)
 
static void finish (void *arg)
 

Public Attributes

QMutex mutex
 
bool running
 
bool finished
 
bool terminated
 
uint stackSize
 
pthread_t thread_id
 
QWaitCondition thread_done
 

Detailed Description

Definition at line 57 of file qthread_p.h.

Constructor & Destructor Documentation

QThreadPrivate::QThreadPrivate ( )

Definition at line 67 of file qthread_unix.cpp.

67  :
69 {
70  thread_id = 0;
71 }
pthread_t thread_id
Definition: qthread_p.h:71
const bool FALSE
Definition: qglobal.h:370
uint stackSize
Definition: qthread_p.h:68
bool terminated
Definition: qthread_p.h:67
QThreadPrivate::~QThreadPrivate ( )

Definition at line 73 of file qthread_unix.cpp.

74 {
75 }

Member Function Documentation

void QThreadPrivate::finish ( void *  arg)
static

Definition at line 93 of file qthread_unix.cpp.

94 {
95  QThread *thr = reinterpret_cast<QThread *>(arg);
96  QThreadPrivate *d = thr->d;
97  QMutexLocker locker(&d->mutex);
98 
99  d->running = FALSE;
100  d->finished = TRUE;
101  if (d->terminated)
102  thr->terminated();
103  d->terminated = FALSE;
104  thr->finished();
105 
106  d->thread_id = 0;
107  d->thread_done.wakeAll();
108 }
pthread_t thread_id
Definition: qthread_p.h:71
G4double thr[100]
Definition: G4S2Light.cc:59
const bool FALSE
Definition: qglobal.h:370
virtual void finished()
Definition: qthread.h:66
virtual void terminated()
Definition: qthread.h:67
QWaitCondition thread_done
Definition: qthread_p.h:72
QThreadPrivate * d
Definition: qthread.h:73
QMutex mutex
Definition: qthread_p.h:63
const bool TRUE
Definition: qglobal.h:371
bool terminated
Definition: qthread_p.h:67
unsigned int __stdcall QThreadPrivate::start ( void *  arg)
static

Definition at line 77 of file qthread_unix.cpp.

78 {
79  pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
80  pthread_cleanup_push(QThreadPrivate::finish, arg);
81 
82  QThread *thr = reinterpret_cast<QThread *>(arg);
83 
84  thr->started();
85  pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
86  pthread_testcancel();
87  thr->run();
88 
89  pthread_cleanup_pop(1);
90  return 0;
91 }
G4double thr[100]
Definition: G4S2Light.cc:59
static void finish(void *arg)
virtual void started()
Definition: qthread.h:65
virtual void run()
Definition: qthread.h:70

Member Data Documentation

bool QThreadPrivate::finished

Definition at line 66 of file qthread_p.h.

QMutex QThreadPrivate::mutex
mutable

Definition at line 63 of file qthread_p.h.

bool QThreadPrivate::running

Definition at line 65 of file qthread_p.h.

uint QThreadPrivate::stackSize

Definition at line 68 of file qthread_p.h.

bool QThreadPrivate::terminated

Definition at line 67 of file qthread_p.h.

QWaitCondition QThreadPrivate::thread_done

Definition at line 72 of file qthread_p.h.

pthread_t QThreadPrivate::thread_id

Definition at line 71 of file qthread_p.h.


The documentation for this class was generated from the following files: