#include <Thread.h>
Inheritance diagram for Thread:

Public Member Functions | |
| Thread (void) | |
| Thread (THREAD_START aExternalRoutine) | |
| ~Thread () | |
| SDL_Thread * | GetHandle (void) |
| const bool | Start (void *aArg=NULL) |
| void | Stop (void) |
| long | GetExitCode () const |
| int | Wait (void) |
| void | Attach (THREAD_START lpThreadFunc) |
| void | Detach (void) |
| virtual long | Run (void *) |
| virtual void | ThreadCtor () |
| virtual void | ThreadDtor () |
Static Protected Member Functions | |
| int __cdecl | EntryPoint (void *pArg) |
Protected Attributes | |
| SDL_Thread * | tid |
| THREAD_START | threadFunc |
| long | threadReturnCode |
| void * | arg |
|
|
Definition at line 24 of file Thread.h. References arg, EntryPoint(), THREAD_START, threadFunc, threadReturnCode, and tid.
00025 : tid( 0 ) , threadReturnCode( -1 ) , arg( 0 ) 00026 { 00027 threadFunc = (THREAD_START)Thread::EntryPoint; // Can call Detach() also. 00028 } |
|
|
Definition at line 36 of file Thread.h. References arg, Attach(), threadReturnCode, and tid.
00037 : tid( 0 ) , threadReturnCode( -1 ) , arg( 0 ) 00038 { 00039 Attach( aExternalRoutine ); 00040 } |
|
|
Definition at line 48 of file Thread.h. References tid.
00049 {
00050 if( tid )
00051 SDL_KillThread( tid );
00052 // if ( m_ThreadCtx.m_hThread ) Stop(true);
00053 }
|
|
|
Definition at line 100 of file Thread.h. References threadFunc. Referenced by Thread().
00100 { threadFunc = lpThreadFunc; }
|
|
|
Definition at line 108 of file Thread.h. References EntryPoint(), and threadFunc.
00108 { threadFunc = Thread::EntryPoint; }
|
|
|
Definition at line 121 of file Thread.h. References __cdecl, arg, Run(), ThreadCtor(), ThreadDtor(), and threadReturnCode. Referenced by Detach(), and Thread().
00122 {
00123 Thread *pParent = reinterpret_cast<Thread*>( pArg );
00124
00125 pParent->ThreadCtor();
00126
00127 pParent->threadReturnCode = pParent->Run( pParent->arg );
00128
00129 pParent->ThreadDtor();
00130
00131 return 0;
00132 }
|
|
|
Definition at line 84 of file Thread.h. References threadReturnCode. Referenced by Wait().
00085 {
00086 return threadReturnCode;
00087 }
|
|
|
Definition at line 58 of file Thread.h. References tid. Referenced by Wait().
00058 { return tid; }
|
|
|
Reimplemented in SetupGalaxyScreen, LoadGalaxyData, InitGalaxyScreen, InitStarInfo, InitStarName, InitPlanetInfo, InitSpecies, InitPlanetSize, InitEcoZone, and Galaxy. Definition at line 143 of file Thread.h. Referenced by EntryPoint().
00143 { return 0; }
|
|
|
Definition at line 65 of file Thread.h. References arg, threadFunc, threadReturnCode, and tid. Referenced by Galaxy::evMessage().
00066 {
00067 tid = SDL_CreateThread( threadFunc , this ); // CreateThread(NULL, 0, m_pThreadFunc, this, 0, &m_ThreadCtx.m_dwTID);
00068 threadReturnCode = 0;
00069 arg = aArg;
00070 return tid != 0;
00071 }
|
|
|
Definition at line 73 of file Thread.h. References tid.
|
|
|
Definition at line 153 of file Thread.h. Referenced by EntryPoint().
00153 { }
|
|
|
Definition at line 163 of file Thread.h. References tid. Referenced by EntryPoint().
00163 { tid = 0; }
|
|
|
Definition at line 89 of file Thread.h. References GetExitCode(), GetHandle(), threadReturnCode, and tid.
00090 {
00091 SDL_WaitThread( GetHandle() , (int *)&threadReturnCode );
00092 tid = 0;
00093 return GetExitCode();
00094
00095 }
|
|
|
Definition at line 18 of file Thread.h. Referenced by EntryPoint(), Galaxy::Run(), Start(), and Thread(). |
|
|
|
|
|
Definition at line 17 of file Thread.h. Referenced by EntryPoint(), GetExitCode(), Start(), Thread(), and Wait(). |
|
|
Definition at line 13 of file Thread.h. Referenced by GetHandle(), Start(), Stop(), Thread(), ThreadDtor(), Wait(), and ~Thread(). |
1.3.3