Eneboo - Documentación para desarrolladores
src/qt/src/tools/qthreadinstance_p.h
Ir a la documentación de este archivo.
00001 /****************************************************************************
00002 ** $Id: qt/qthreadinstance_p.h   3.3.8   edited Jan 11 14:46 $
00003 **
00004 ** ...
00005 **
00006 ** Copyright (C) 2005-2007 Trolltech ASA.  All rights reserved.
00007 **
00008 ** This file is part of the tools module of the Qt GUI Toolkit.
00009 **
00010 ** This file may be distributed under the terms of the Q Public License
00011 ** as defined by Trolltech ASA of Norway and appearing in the file
00012 ** LICENSE.QPL included in the packaging of this file.
00013 **
00014 ** This file may be distributed and/or modified under the terms of the
00015 ** GNU General Public License version 2 as published by the Free Software
00016 ** Foundation and appearing in the file LICENSE.GPL included in the
00017 ** packaging of this file.
00018 **
00019 ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
00020 ** licenses may use this file in accordance with the Qt Commercial License
00021 ** Agreement provided with the Software.
00022 **
00023 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00024 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00025 **
00026 ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
00027 **   information about Qt Commercial License Agreements.
00028 ** See http://www.trolltech.com/qpl/ for QPL licensing information.
00029 ** See http://www.trolltech.com/gpl/ for GPL licensing information.
00030 **
00031 ** Contact info@trolltech.com if any conditions of this licensing are
00032 ** not clear to you.
00033 **
00034 **********************************************************************/
00035 
00036 #ifndef QTHREAD_P_H
00037 #define QTHREAD_P_H
00038 
00039 //
00040 //  W A R N I N G
00041 //  -------------
00042 //
00043 // This file is not part of the Qt API.  It exists for the convenience
00044 // of QThread and QThreadStorage. This header file may change from
00045 // version to version without notice, or even be removed.
00046 //
00047 // We mean it.
00048 //
00049 //
00050 
00051 #ifdef QT_THREAD_SUPPORT
00052 
00053 #ifndef QT_H
00054 #include "qmutex.h"
00055 #include "qwindowdefs.h"
00056 #endif // QT_H
00057 
00058 #if defined(Q_OS_UNIX) || defined(__MINGW32__)
00059 #include <pthread.h>
00060 #endif
00061 
00062 class QThreadInstance {
00063 public:
00064     static QThreadInstance *current();
00065 
00066     void init(unsigned int stackSize);
00067     void deinit();
00068 
00069     QMutex *mutex() const;
00070     void terminate();
00071 
00072     unsigned int stacksize;
00073     void *args[2];
00074     void **thread_storage;
00075     bool finished : 1;
00076     bool running  : 1;
00077     bool orphan   : 1;
00078 
00079 #if defined(Q_OS_UNIX) || defined(__MINGW32__)
00080     pthread_cond_t thread_done;
00081     pthread_t thread_id;
00082 
00083     static void *start( void * );
00084     static void finish( void * );
00085 #endif // Q_OS_UNIX
00086 
00087 #if defined(Q_OS_WIN32) && !defined(__MINGW32__)
00088     Qt::HANDLE handle;
00089     unsigned int thread_id;
00090     int waiters;
00091 
00092     static unsigned int __stdcall start( void * );
00093     static void finish( QThreadInstance * );
00094 #endif // Q_OS_WIN32
00095 };
00096 
00097 #endif // QT_THREAD_SUPPORT
00098 #endif // QTHREAD_P_H
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'