Tiberian Technologies Scripts Reference Revision: 9000
Loading...
Searching...
No Matches
ThreadClass.h
1/* Renegade Scripts.dll
2 Copyright 2013 Tiberian Technologies
3
4 This file is part of the Renegade scripts.dll
5 The Renegade scripts.dll is free software; you can redistribute it and/or modify it under
6 the terms of the GNU General Public License as published by the Free
7 Software Foundation; either version 2, or (at your option) any later
8 version. See the file COPYING for more details.
9 In addition, an exemption is given to allow Run Time Dynamic Linking of this code with any closed source module that does not contain code covered by this licence.
10 Only the source code to the module(s) containing the licenced code has to be released.
11*/
12#ifndef TT_INCLUDE__THREADCLASS_H
13#define TT_INCLUDE__THREADCLASS_H
14
15
16
17class SCRIPTS_API ThreadClass
18{
19
20public:
21 bool running; //4
22 char name[67]; //5
23 int threadid; //48
24 LONG (WINAPI *exceptionhandler)(int, LPEXCEPTION_POINTERS); //4C
25 HANDLE handle; //50
26 int thread_priority; //54
27 ThreadClass(char const *Name, LONG (WINAPI *ExceptionHandler)(int, LPEXCEPTION_POINTERS));
28 virtual ~ThreadClass();
29 virtual void Thread_Function() = 0;
30 static void Internal_Thread_Function(void*);
31 void Execute();
32 void Set_Priority(int);
33 void Stop(uint);
34 static void Sleep_Ms(uint);
35
36 bool Is_Running()
37 {
38 return handle != 0;
39 }
40 static int Get_Current_Thread_ID()
41 {
42 return GetCurrentThreadId();
43 }
44 const char *Get_Name()
45 {
46 return name;
47 }
48};
49
50
51
52#endif