/usr/include/codeblocks/managedthread.h is in codeblocks-dev 13.12-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | /*
* This file is part of the Code::Blocks IDE and licensed under the GNU Lesser General Public License, version 3
* http://www.gnu.org/licenses/lgpl-3.0.html
*/
#ifndef managedthread_h
#define managedthread_h
#include <wx/thread.h>
#include <wx/dynarray.h>
class ManagedThread;
WX_DEFINE_ARRAY(ManagedThread*, ManagedThreadsArray);
class ManagedThread : public wxThread
{
public:
ManagedThread(bool* abortflag = nullptr);
virtual ~ManagedThread();
static unsigned long count_running();
static unsigned long count_threads();
static void abort_all(); // Warning! Once set, can't be reset!
static void abort(bool* flag,bool delete_thread = true);
bool* get_abort_location() { if(!this) return nullptr;return m_pAbort; }
void set_abort_location(bool* abortflag)
{
if(!this) return;
m_pAbort=abortflag;
}
protected:
virtual bool TestDestroy();
virtual void* DoRun(); // Override it for your own class. Called by Entry()
virtual void* Entry();
bool is_aborted();
static ManagedThread* GetThread(size_t n);
static void DeleteThreadFromList(ManagedThread* thread);
static wxCriticalSection s_count_running_mutex;
static wxCriticalSection s_list_mutex;
static unsigned long s_running;
bool* m_pAbort;
static bool s_abort_all;
};
#endif
|