1
#ifndef managedthread_h
2
#define managedthread_h
5
#include <wx/dynarray.h>
9
WX_DEFINE_ARRAY(ManagedThread*, ManagedThreadsArray);
11
class ManagedThread : public wxThread
14
ManagedThread(bool* abortflag = 0L);
15
virtual ~ManagedThread();
16
static unsigned long count_running();
17
static unsigned long count_threads();
18
static void abort_all(); // Warning! Once set, can't be reset!
19
static void abort(bool* flag,bool delete_thread = true);
20
bool* get_abort_location() { if(!this) return 0L;return m_pAbort; }
21
void set_abort_location(bool* abortflag)
27
virtual bool TestDestroy();
28
virtual void* DoRun(); // Override it for your own class. Called by Entry()
29
virtual void* Entry();
31
static ManagedThread* GetThread(size_t n);
32
static void DeleteThreadFromList(ManagedThread* thread);
34
static wxCriticalSection s_count_running_mutex;
35
static wxCriticalSection s_list_mutex;
36
static unsigned long s_running;
38
static bool s_abort_all;