Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00013 #ifndef THREAD_POOL_H
00014 #define THREAD_POOL_H
00015
00016 #include "thread-queue.h"
00017 #include "during-if.h"
00018 #include "thread-pool-base.h"
00019
00020 class thread_pool : public thread_pool_base {
00021 public:
00022 static thread_pool *get_instance();
00023 static thread_pool *get_instance(int nb_threads);
00024 static void delete_instance();
00025 private:
00026 static thread_pool *m_instance;
00027 thread_pool(int thread_pool);
00028 ~thread_pool();
00029
00030 public:
00031 void queue(sync_task *r, sc_core::sc_process_b *current = NULL) {
00032 (void)current;
00033
00034 m_task_queue.push(r);
00035 }
00036
00037 int get_queue_size() {return m_task_queue.size();}
00038
00039 private:
00040 sync_task *pop_task(sc_core::sc_process_b *sc_process) {
00041 (void)sc_process;
00042 return m_task_queue.pop_front();
00043 }
00044
00045 thread_queue<sync_task *> m_task_queue;
00046 };
00047
00048 #endif // THREAD_POOL_H