24 #ifndef __LIBS_BASEAPP_THREAD_MANAGER_H_
25 #define __LIBS_BASEAPP_THREAD_MANAGER_H_
27 #include <core/threading/thread_list.h>
28 #include <core/threading/thread_collector.h>
29 #include <core/exception.h>
30 #include <aspect/blocked_timing.h>
31 #include <aspect/blocked_timing/executor.h>
33 #include <core/utils/lock_map.h>
42 class ThreadInitializer;
43 class ThreadFinalizer;
59 add_maybelocked(tl,
true);
64 add_maybelocked(t,
true);
69 remove_maybelocked(tl,
true);
74 remove_maybelocked(t,
true);
78 virtual void force_remove(
Thread *t);
81 unsigned int timeout_usec = 0);
84 virtual void try_recover(std::list<std::string> &recovered_threads);
86 virtual bool timed_threads_exist();
87 virtual void wait_for_timed_threads();
88 virtual void interrupt_timed_thread_wait();
93 void internal_add_thread(
Thread *t);
94 void internal_remove_thread(
Thread *t);
95 void add_maybelocked(
ThreadList &tl,
bool lock);
96 void add_maybelocked(
Thread *t,
bool lock);
97 void remove_maybelocked(
ThreadList &tl,
bool lock);
98 void remove_maybelocked(
Thread *t,
bool lock);
106 virtual void add(
Thread *t);
109 virtual void remove(
Thread *t);
112 virtual void force_remove(
Thread *t);
119 ThreadInitializer *__initializer;
120 ThreadFinalizer *__finalizer;
122 LockMap< BlockedTimingAspect::WakeupHook, ThreadList > __threads;
123 LockMap< BlockedTimingAspect::WakeupHook, ThreadList >::iterator __tit;
125 ThreadList __untimed_threads;
126 WaitCondition *__waitcond_timedthreads;
128 ThreadManagerAspectCollector *__aspect_collector;
129 bool __interrupt_timed_thread_wait;
virtual void add(ThreadList &tl)
Add multiple threads.
Thread class encapsulation of pthreads.
Base application thread manager.
WakeupHook
Type to define at which hook the thread is woken up.
Thread initializer interface.
virtual void add(Thread *t)
Add single thread.
A barrier is a synchronization tool which blocks until a given number of threads have reached the bar...
Thread finalizer interface.