threads.h

main 51 lines · 1.4 KB Raw
Alex Alex Commit Map Editor 18/10/2026 23:40
1//////////////////////////////////////////////////////////////////////
2// This file is part of Remere's Map Editor
3//////////////////////////////////////////////////////////////////////
4// Remere's Map Editor is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// Remere's Map Editor is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program. If not, see <http://www.gnu.org/licenses/>.
16//////////////////////////////////////////////////////////////////////
17
18#ifndef RME_THREAD_H_
19#define RME_THREAD_H_
20
21#include "main.h"
22
23class Thread : public wxThread {
24public:
25 Thread(wxThreadKind);
26
27 void Execute(); // Calls "Create" and then "Run"
28};
29
30class JoinableThread : public Thread {
31public:
32 JoinableThread() :
33 Thread(wxTHREAD_JOINABLE) { }
34};
35
36class DetachedThread : public Thread {
37public:
38 DetachedThread() :
39 Thread(wxTHREAD_DETACHED) { }
40};
41
42inline Thread::Thread(wxThreadKind kind) :
43 wxThread(kind) { }
44
45inline void Thread::Execute() {
46 Create();
47 Run();
48}
49
50#endif
51
Top