Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00014 #include "during-pool.h"
00015 #include "thread-pool.h"
00016 #include "task-manager.h"
00017 #include "thread-queue.h"
00018 #include "utils/io-lock.h"
00019
00020 #include <systemc>
00021 using namespace std;
00022
00023 sc_during_pool::sc_during_pool() {
00024 thread_pool::get_instance();
00025 L_COUT << "// TEST-IGNORE: sc_during_pool instanciated" << std::endl;
00026 }
00027
00028 sc_during_pool::~sc_during_pool() {
00029 thread_pool::delete_instance();
00030 }
00031
00032 void sc_during_pool::extra_time(const sc_core::sc_time & t) {
00033 task_manager::get_instance()->get_current_task()->extra_time(t);
00034 }
00035
00036 void sc_during_pool::catch_up(const sc_core::sc_time & t) {
00037 task_manager::get_instance()->get_current_task()->catch_up(t);
00038 }
00039
00040 void sc_during_pool::sc_call(const boost::function<void()> & f) {
00041 task_manager::get_instance()->get_current_task()->sc_call(f);
00042 };
00043
00044 void sc_during_pool::during(const sc_core::sc_time & time,
00045 const boost::function<void()> & routine) {
00046 sync_task r(routine, time);
00047 thread_pool::get_instance()->queue(&r);
00048 r.wait_for_completion();
00049 }
00050
00051