123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- #ifndef Thread_H
- #define Thread_H
- #include "Array.h"
- namespace Framework
- {
- class Thread;
-
- class Thread
- {
- protected:
- #ifdef WIN32
- void *threadHandle;
- unsigned long threadId;
- #else
- pthread_t threadHandle;
- #endif
- bool run;
- public:
-
- __declspec( dllexport ) Thread();
-
- __declspec( dllexport ) ~Thread();
-
- __declspec( dllexport ) void start();
- #ifdef WIN32
-
- __declspec( dllexport ) void pause();
-
- __declspec( dllexport ) void fortsetzen();
- #endif
-
- __declspec( dllexport ) void ende();
-
- __declspec( dllexport ) virtual void thread();
-
- __declspec( dllexport ) virtual void threadEnd();
-
-
-
- __declspec( dllexport ) bool läuft() const;
-
-
- __declspec( dllexport ) int warteAufThread( int zeit ) const;
- #ifdef WIN32
-
- __declspec( dllexport ) void *getThreadHandle() const;
- #endif
- };
- #ifdef WIN32
-
- __declspec( dllexport ) unsigned long __stdcall threadStart( void *param );
- #else
-
- void *threadStart( void *param );
- #endif
-
- class ThreadRegister
- {
- private:
- Array< Thread* > threads;
- public:
-
-
- void add( Thread *t );
-
-
- void remove( Thread *t );
-
-
- bool isThread( Thread *t ) const;
- };
- }
- #endif
|